lib/inch/language/nodejs/provider/jsdoc/object/base.rb in inch-0.5.9 vs lib/inch/language/nodejs/provider/jsdoc/object/base.rb in inch-0.5.10

- old
+ new

@@ -20,11 +20,11 @@ def name @hash['name'] end def fullname - "#{@hash['longname']}" + @hash['longname'] end # Returns all files declaring the object in the form of an Array # of Arrays containing the location of their declaration. # @@ -45,15 +45,11 @@ def children_fullnames @children_fullnames ||= [] end def parent_fullname - if depth == 1 - nil - else - fullname.split('.')[0...-1].join('.') - end + @hash['memberof'] || retrieve_parent_fullname end def api_tag? nil end @@ -98,19 +94,19 @@ def has_children? !children_fullnames.empty? end def has_code_example? - false # raise NotImplementedError + docstring.code_examples.size > 0 end def has_doc? !undocumented? end def has_multiple_code_examples? - false # raise NotImplementedError + docstring.code_examples.size > 1 end def has_unconsidered_tags? false # raise NotImplementedError end @@ -149,11 +145,11 @@ [] end end def private? - false + visibility == 'private' end def tagged_as_internal_api? false end @@ -161,31 +157,31 @@ def tagged_as_private? nodoc? end def protected? - false + visibility == 'protected' end def public? - true + visibility == 'public' end def questioning_name? fullname =~ /\?$/ end def return_described? - false # raise NotImplementedError + docstring.describes_return? end def return_mentioned? - false # raise NotImplementedError + docstring.mentions_return? end def return_typed? - false # raise NotImplementedError + return_mentioned? end def in_root? depth == 1 end @@ -205,20 +201,28 @@ def undocumented? @hash['comment'].to_s.empty? end def visibility - docstring.visibility + docstring.visibility(@hash['access']) end protected def meta? !meta.nil? && meta.is_a?(Hash) end def meta @hash['meta'] + end + + def retrieve_parent_fullname + if depth == 1 + nil + else + fullname.split('.')[0...-1].join('.') + end end end end end end