inch 0.5.0.rc5 → 0.5.0.rc6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (166) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +0 -6
  3. data/.rubocop_todo.yml +40 -34
  4. data/Gemfile +3 -3
  5. data/Rakefile +10 -6
  6. data/bin/inch +5 -5
  7. data/config/base.rb +4 -4
  8. data/config/nodejs.rb +44 -1
  9. data/config/ruby.rb +1 -1
  10. data/inch.gemspec +17 -17
  11. data/lib/inch.rb +13 -13
  12. data/lib/inch/api.rb +10 -10
  13. data/lib/inch/api/compare.rb +2 -2
  14. data/lib/inch/api/compare/code_objects.rb +1 -1
  15. data/lib/inch/api/diff.rb +1 -1
  16. data/lib/inch/api/options/suggest.rb +1 -1
  17. data/lib/inch/api/suggest.rb +1 -1
  18. data/lib/inch/cli.rb +6 -6
  19. data/lib/inch/cli/command.rb +15 -15
  20. data/lib/inch/cli/command/base.rb +5 -3
  21. data/lib/inch/cli/command/base_list.rb +0 -1
  22. data/lib/inch/cli/command/console.rb +5 -5
  23. data/lib/inch/cli/command/diff.rb +6 -6
  24. data/lib/inch/cli/command/inspect.rb +5 -5
  25. data/lib/inch/cli/command/list.rb +4 -4
  26. data/lib/inch/cli/command/options/base.rb +17 -15
  27. data/lib/inch/cli/command/options/base_list.rb +17 -17
  28. data/lib/inch/cli/command/options/base_object.rb +1 -1
  29. data/lib/inch/cli/command/options/console.rb +13 -13
  30. data/lib/inch/cli/command/options/diff.rb +19 -19
  31. data/lib/inch/cli/command/options/inspect.rb +5 -5
  32. data/lib/inch/cli/command/options/list.rb +7 -7
  33. data/lib/inch/cli/command/options/show.rb +5 -5
  34. data/lib/inch/cli/command/options/stats.rb +2 -2
  35. data/lib/inch/cli/command/options/suggest.rb +12 -12
  36. data/lib/inch/cli/command/output/base.rb +1 -1
  37. data/lib/inch/cli/command/output/diff.rb +9 -9
  38. data/lib/inch/cli/command/output/inspect.rb +13 -13
  39. data/lib/inch/cli/command/output/list.rb +1 -1
  40. data/lib/inch/cli/command/output/show.rb +4 -4
  41. data/lib/inch/cli/command/output/stats.rb +14 -14
  42. data/lib/inch/cli/command/output/suggest.rb +14 -14
  43. data/lib/inch/cli/command/show.rb +4 -4
  44. data/lib/inch/cli/command/stats.rb +4 -4
  45. data/lib/inch/cli/command/suggest.rb +4 -4
  46. data/lib/inch/cli/command_parser.rb +4 -4
  47. data/lib/inch/cli/sparkline_helper.rb +1 -1
  48. data/lib/inch/cli/trace_helper.rb +1 -1
  49. data/lib/inch/cli/yardopts_helper.rb +1 -1
  50. data/lib/inch/code_object.rb +3 -3
  51. data/lib/inch/code_object/provider.rb +3 -3
  52. data/lib/inch/code_object/proxy.rb +3 -4
  53. data/lib/inch/codebase.rb +5 -5
  54. data/lib/inch/codebase/object.rb +2 -1
  55. data/lib/inch/codebase/serializer.rb +2 -2
  56. data/lib/inch/config.rb +6 -6
  57. data/lib/inch/config/codebase.rb +5 -5
  58. data/lib/inch/core_ext.rb +1 -1
  59. data/lib/inch/core_ext/string.rb +1 -1
  60. data/lib/inch/evaluation.rb +8 -8
  61. data/lib/inch/evaluation/proxy.rb +2 -3
  62. data/lib/inch/evaluation/role.rb +1 -1
  63. data/lib/inch/language/elixir/code_object/base.rb +6 -4
  64. data/lib/inch/language/elixir/evaluation/base.rb +2 -1
  65. data/lib/inch/language/elixir/evaluation/function_object.rb +1 -1
  66. data/lib/inch/language/elixir/import.rb +14 -14
  67. data/lib/inch/language/elixir/provider/reader.rb +1 -1
  68. data/lib/inch/language/elixir/provider/reader/docstring.rb +13 -0
  69. data/lib/inch/language/elixir/provider/reader/object.rb +5 -5
  70. data/lib/inch/language/elixir/provider/reader/object/base.rb +13 -5
  71. data/lib/inch/language/elixir/provider/reader/object/function_object.rb +1 -1
  72. data/lib/inch/language/elixir/provider/reader/parser.rb +21 -7
  73. data/lib/inch/language/elixir/roles/base.rb +3 -3
  74. data/lib/inch/language/elixir/roles/function.rb +2 -1
  75. data/lib/inch/language/elixir/roles/object.rb +1 -1
  76. data/lib/inch/language/nodejs/code_object/base.rb +199 -0
  77. data/lib/inch/language/nodejs/code_object/function_object.rb +74 -0
  78. data/lib/inch/language/nodejs/code_object/member_object.rb +11 -0
  79. data/lib/inch/language/nodejs/code_object/module_object.rb +23 -0
  80. data/lib/inch/language/nodejs/evaluation/base.rb +29 -0
  81. data/lib/inch/language/nodejs/evaluation/function_object.rb +31 -0
  82. data/lib/inch/language/nodejs/evaluation/member_object.rb +11 -0
  83. data/lib/inch/language/nodejs/evaluation/module_object.rb +27 -0
  84. data/lib/inch/language/nodejs/import.rb +17 -1
  85. data/lib/inch/language/nodejs/provider/jsdoc.rb +1 -1
  86. data/lib/inch/language/nodejs/provider/jsdoc/docstring.rb +13 -0
  87. data/lib/inch/language/nodejs/provider/jsdoc/object.rb +16 -8
  88. data/lib/inch/language/nodejs/provider/jsdoc/object/base.rb +82 -45
  89. data/lib/inch/language/nodejs/provider/jsdoc/object/function_object.rb +18 -0
  90. data/lib/inch/language/nodejs/provider/jsdoc/object/member_object.rb +15 -0
  91. data/lib/inch/language/nodejs/provider/jsdoc/object/module_object.rb +22 -0
  92. data/lib/inch/language/nodejs/provider/jsdoc/parser.rb +9 -10
  93. data/lib/inch/language/nodejs/roles/base.rb +32 -0
  94. data/lib/inch/language/nodejs/roles/function.rb +113 -0
  95. data/lib/inch/language/nodejs/roles/member.rb +13 -0
  96. data/lib/inch/language/nodejs/roles/module.rb +64 -0
  97. data/lib/inch/language/nodejs/roles/object.rb +76 -0
  98. data/lib/inch/language/ruby/code_object/base.rb +6 -4
  99. data/lib/inch/language/ruby/evaluation/base.rb +2 -1
  100. data/lib/inch/language/ruby/evaluation/method_object.rb +2 -1
  101. data/lib/inch/language/ruby/import.rb +24 -24
  102. data/lib/inch/language/ruby/provider/yard.rb +10 -10
  103. data/lib/inch/language/ruby/provider/yard/nodoc_helper.rb +2 -2
  104. data/lib/inch/language/ruby/provider/yard/object.rb +9 -9
  105. data/lib/inch/language/ruby/provider/yard/object/base.rb +25 -28
  106. data/lib/inch/language/ruby/provider/yard/object/method_object.rb +4 -3
  107. data/lib/inch/language/ruby/provider/yard/object/method_parameter_object.rb +4 -3
  108. data/lib/inch/language/ruby/provider/yard/object/method_signature.rb +2 -2
  109. data/lib/inch/language/ruby/provider/yard/object/namespace_object.rb +2 -1
  110. data/lib/inch/language/ruby/provider/yard/parser.rb +2 -2
  111. data/lib/inch/language/ruby/roles/base.rb +1 -1
  112. data/lib/inch/language/ruby/roles/method.rb +2 -1
  113. data/lib/inch/language/ruby/roles/method_parameter.rb +1 -1
  114. data/lib/inch/language/ruby/roles/missing.rb +2 -2
  115. data/lib/inch/language/ruby/roles/object.rb +6 -6
  116. data/lib/inch/rake.rb +2 -2
  117. data/lib/inch/rake/suggest.rb +5 -5
  118. data/lib/inch/utils/code_location.rb +12 -0
  119. data/lib/inch/utils/read_write_methods.rb +2 -2
  120. data/lib/inch/utils/ui.rb +8 -8
  121. data/lib/inch/version.rb +1 -1
  122. data/test/fixtures/elixir/simple/all.json +321 -0
  123. data/test/integration/api/compare/codebases.rb +6 -6
  124. data/test/integration/cli/command/console_test.rb +13 -13
  125. data/test/integration/cli/command/diff_test.rb +12 -14
  126. data/test/integration/cli/command/inspect_test.rb +30 -30
  127. data/test/integration/cli/command/list_test.rb +34 -34
  128. data/test/integration/cli/command/show_test.rb +26 -26
  129. data/test/integration/cli/command/stats_test.rb +23 -23
  130. data/test/integration/cli/command/suggest_test.rb +58 -49
  131. data/test/integration/stats_options_test.rb +9 -9
  132. data/test/integration/visibility_options_test.rb +49 -45
  133. data/test/shared/base_list.rb +41 -41
  134. data/test/test_helper.rb +18 -10
  135. data/test/unit/api/filter_test.rb +9 -9
  136. data/test/unit/api/get_test.rb +6 -6
  137. data/test/unit/api/list_test.rb +3 -3
  138. data/test/unit/api/options/base_test.rb +6 -6
  139. data/test/unit/api/stats_test.rb +3 -3
  140. data/test/unit/api/suggest_test.rb +4 -4
  141. data/test/unit/cli/arguments_test.rb +25 -25
  142. data/test/unit/cli/command/base_test.rb +3 -3
  143. data/test/unit/cli/command/options/base_list_test.rb +14 -14
  144. data/test/unit/cli/command/options/base_object_test.rb +6 -6
  145. data/test/unit/cli/command/options/base_test.rb +3 -3
  146. data/test/unit/cli/command_parser_test.rb +29 -29
  147. data/test/unit/cli/trace_helper_test.rb +2 -2
  148. data/test/unit/cli/yardopts_helper_test.rb +35 -35
  149. data/test/unit/code_object/converter_test.rb +3 -3
  150. data/test/unit/code_object/provider_test.rb +2 -2
  151. data/test/unit/code_object/proxy_test.rb +11 -11
  152. data/test/unit/codebase/objects_test.rb +8 -8
  153. data/test/unit/codebase/proxy_test.rb +5 -5
  154. data/test/unit/config/codebase_test.rb +3 -3
  155. data/test/unit/config_test.rb +4 -4
  156. data/test/unit/evaluation/role_test.rb +8 -8
  157. data/test/unit/language/elixir/code_object/function_object_test.rb +35 -0
  158. data/test/unit/language/ruby/code_object/method_object_test.rb +128 -126
  159. data/test/unit/language/ruby/provider/yard/docstring_test.rb +27 -23
  160. data/test/unit/language/ruby/provider/yard/nodoc_helper_test.rb +21 -20
  161. data/test/unit/language/ruby/provider/yard/object/method_object_test.rb +20 -17
  162. data/test/unit/language/ruby/provider/yard_test.rb +4 -4
  163. data/test/unit/utils/buffered_ui_test.rb +20 -20
  164. data/test/unit/utils/ui_test.rb +20 -20
  165. data/test/unit/utils/weighted_list_test.rb +7 -7
  166. metadata +25 -2
@@ -0,0 +1,11 @@
1
+ module Inch
2
+ module Language
3
+ module Nodejs
4
+ module CodeObject
5
+ # Proxy class for types
6
+ class MemberObject < Base
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,23 @@
1
+ module Inch
2
+ module Language
3
+ module Nodejs
4
+ module CodeObject
5
+ # Proxy class for modules
6
+ class ModuleObject < Base
7
+ MANY_CHILDREN_THRESHOLD = 20
8
+ def has_many_children?
9
+ children.size > MANY_CHILDREN_THRESHOLD
10
+ end
11
+
12
+ def has_methods?
13
+ children.any?(&:method?)
14
+ end
15
+
16
+ def pure_namespace?
17
+ children.all?(&:namespace?)
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,29 @@
1
+ module Inch
2
+ module Language
3
+ module Nodejs
4
+ module Evaluation
5
+ # Base class for all Nodejs related evaluations
6
+ #
7
+ # @abstract
8
+ class Base < Inch::Evaluation::Proxy
9
+ protected
10
+
11
+ def relevant_base_roles
12
+ {
13
+ Role::Object::InRoot => nil,
14
+ Role::Object::Public => nil,
15
+ Role::Object::TaggedAsNodoc => nil,
16
+ Role::Object::WithDoc => score_for(:docstring),
17
+ Role::Object::WithoutDoc => score_for(:docstring),
18
+ Role::Object::WithCodeExample => score_for(:code_example_single),
19
+ Role::Object::WithMultipleCodeExamples =>
20
+ score_for(:code_example_multi),
21
+ Role::Object::WithoutCodeExample =>
22
+ score_for(:code_example_single)
23
+ }
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,31 @@
1
+ module Inch
2
+ module Language
3
+ module Nodejs
4
+ module Evaluation
5
+ # Proxy class for functions
6
+ class FunctionObject < Base
7
+ protected
8
+
9
+ def relevant_roles
10
+ relevant_base_roles.merge(relevant_function_roles)
11
+ end
12
+
13
+ def relevant_function_roles
14
+ {
15
+ Role::Function::Getter => nil,
16
+ Role::Function::Setter => nil,
17
+ Role::Function::Overridden =>
18
+ if object.overridden?
19
+ object.overridden_method.score
20
+ else
21
+ nil
22
+ end,
23
+ Role::Function::WithBangName => nil,
24
+ Role::Function::WithQuestioningName => nil
25
+ }
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,11 @@
1
+ module Inch
2
+ module Language
3
+ module Nodejs
4
+ module Evaluation
5
+ # Proxy class for types
6
+ class MemberObject < Base
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,27 @@
1
+ module Inch
2
+ module Language
3
+ module Nodejs
4
+ module Evaluation
5
+ # Proxy class for modules
6
+ class ModuleObject < Base
7
+ protected
8
+
9
+ def relevant_roles
10
+ relevant_base_roles.merge(relevant_namespace_roles)
11
+ end
12
+
13
+ # @see Evaluation::Ruby::Base
14
+ def relevant_namespace_roles
15
+ {
16
+ Role::Module::WithoutChildren => nil,
17
+ Role::Module::WithChildren => nil,
18
+ Role::Module::WithManyChildren => nil,
19
+ Role::Module::WithoutMethods => nil,
20
+ Role::Module::Pure => nil
21
+ }
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -5,4 +5,20 @@ module Inch
5
5
  end
6
6
  end
7
7
 
8
- require "inch/language/nodejs/provider/jsdoc"
8
+ require 'inch/language/nodejs/provider/jsdoc'
9
+
10
+ require 'inch/language/nodejs/code_object/base'
11
+ require 'inch/language/nodejs/code_object/module_object'
12
+ require 'inch/language/nodejs/code_object/function_object'
13
+ require 'inch/language/nodejs/code_object/member_object'
14
+
15
+ require 'inch/language/nodejs/evaluation/base'
16
+ require 'inch/language/nodejs/evaluation/module_object'
17
+ require 'inch/language/nodejs/evaluation/function_object'
18
+ require 'inch/language/nodejs/evaluation/member_object'
19
+
20
+ require 'inch/language/nodejs/roles/base'
21
+ require 'inch/language/nodejs/roles/object'
22
+ require 'inch/language/nodejs/roles/module'
23
+ require 'inch/language/nodejs/roles/function'
24
+ require 'inch/language/nodejs/roles/member'
@@ -16,4 +16,4 @@ module Inch
16
16
  end
17
17
  end
18
18
 
19
- require "inch/language/nodejs/provider/jsdoc/parser"
19
+ require 'inch/language/nodejs/provider/jsdoc/parser'
@@ -0,0 +1,13 @@
1
+
2
+ module Inch
3
+ module Language
4
+ module Nodejs
5
+ module Provider
6
+ module JSDoc
7
+ class Docstring < Ruby::Provider::YARD::Docstring
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -1,3 +1,8 @@
1
+ require 'inch/language/nodejs/provider/jsdoc/object/base'
2
+ require 'inch/language/nodejs/provider/jsdoc/object/function_object'
3
+ require 'inch/language/nodejs/provider/jsdoc/object/module_object'
4
+ require 'inch/language/nodejs/provider/jsdoc/object/member_object'
5
+
1
6
  module Inch
2
7
  module Language
3
8
  module Nodejs
@@ -17,7 +22,7 @@ module Inch
17
22
  # @return [Provider::JSDoc::Object]
18
23
  def for(jsdoc_object)
19
24
  @cache ||= {}
20
- if proxy_object = @cache[cache_key(jsdoc_object)]
25
+ if (proxy_object = @cache[cache_key(jsdoc_object)])
21
26
  proxy_object
22
27
  else
23
28
  @cache[cache_key(jsdoc_object)] =
@@ -27,15 +32,15 @@ module Inch
27
32
 
28
33
  private
29
34
 
30
- # Returns a Proxy class for the given +jsdoc_object+
35
+ # Returns a Proxy class for the given +json_object+
31
36
  #
32
- # @param jsdoc_object [Hash]
37
+ # @param json_object [Hash]
33
38
  # @return [Class]
34
- def class_for(jsdoc_object)
35
- class_name = jsdoc_object.class.to_s.split("::").last
36
- const_get(class_name)
39
+ def class_for(json_object)
40
+ class_name = json_object['kind'].capitalize + 'Object'
41
+ JSDoc::Object.const_get(class_name)
37
42
  rescue NameError
38
- Base
43
+ JSDoc::Object::Base
39
44
  end
40
45
 
41
46
  # Returns a cache key for the given +jsdoc_object+
@@ -44,7 +49,10 @@ module Inch
44
49
  # @return [String]
45
50
  def cache_key(jsdoc_object)
46
51
  return if jsdoc_object['meta'].nil?
47
- "#{jsdoc_object['meta']['path']}/#{jsdoc_object['meta']['path']}:#{jsdoc_object['meta']['lineno']}"
52
+ "#{jsdoc_object['longname']}/" \
53
+ "#{jsdoc_object['meta']['path']}/" \
54
+ "#{jsdoc_object['meta']['filename']}:" \
55
+ "#{jsdoc_object['meta']['lineno']}"
48
56
  end
49
57
  end
50
58
  end
@@ -1,3 +1,6 @@
1
+ require 'inch/language/nodejs/provider/jsdoc/docstring'
2
+ require 'inch/utils/code_location'
3
+
1
4
  module Inch
2
5
  module Language
3
6
  module Nodejs
@@ -6,181 +9,215 @@ module Inch
6
9
  module Object
7
10
  # @abstract
8
11
  class Base
12
+ # @return [String] the codebase's directory
13
+ attr_accessor :base_dir
14
+
9
15
  # @param hash [Hash] hash returned via JSON interface
10
16
  def initialize(hash)
11
17
  @hash = hash
12
18
  end
13
19
 
14
20
  def name
15
- raise NotImplementedError
21
+ @hash['name']
16
22
  end
17
23
 
18
24
  def fullname
19
- raise NotImplementedError
20
- end
21
-
25
+ #fail NotImplementedError
26
+ base = "#{@hash['longname']}"
27
+ if meta?
28
+ base << " @ #{meta['path']}/" \
29
+ "#{meta['filename']}:" \
30
+ "#{meta['lineno']}"
31
+ end
32
+ base
33
+ end
34
+
35
+ # Returns all files declaring the object in the form of an Array
36
+ # of Arrays containing the location of their declaration.
37
+ #
38
+ # @return [Array<CodeLocation>]
22
39
  def files
23
- raise NotImplementedError
40
+ return [] unless meta?
41
+ filename = meta['path'] + '/' + meta['filename']
42
+ [
43
+ Inch::Utils::CodeLocation.new('', filename, meta['lineno'])
44
+ ]
24
45
  end
25
46
 
26
47
  def filename
27
- raise NotImplementedError
48
+ files.first.filename unless files.empty?
28
49
  end
29
50
 
51
+ attr_writer :children_fullnames
30
52
  def children_fullnames
31
- raise NotImplementedError
53
+ @children_fullnames ||= []
32
54
  end
33
55
 
34
56
  def parent_fullname
35
- raise NotImplementedError
57
+ if depth == 1
58
+ nil
59
+ else
60
+ fullname.split('.')[0...-1].join('.')
61
+ end
36
62
  end
37
63
 
38
64
  def api_tag?
39
- raise NotImplementedError
65
+ nil
40
66
  end
41
67
 
42
68
  def aliased_object_fullname
43
- raise NotImplementedError
69
+ nil
44
70
  end
45
71
 
46
72
  def aliases_fullnames
47
- raise NotImplementedError
73
+ nil
48
74
  end
49
75
 
50
76
  def attributes
51
- raise NotImplementedError
77
+ []
52
78
  end
53
79
 
54
80
  def bang_name?
55
- raise NotImplementedError
81
+ false
56
82
  end
57
83
 
58
84
  def constant?
59
- raise NotImplementedError
85
+ false # raise NotImplementedError
60
86
  end
61
87
 
62
88
  def constructor?
63
- raise NotImplementedError
89
+ false
64
90
  end
65
91
 
66
92
  def depth
67
- raise NotImplementedError
93
+ fullname.split('.').size
68
94
  end
69
95
 
96
+ # @return [Docstring]
70
97
  def docstring
71
- raise NotImplementedError
98
+ @docstring ||= Docstring.new(@hash['comment'])
72
99
  end
73
100
 
74
101
  def getter?
75
- raise NotImplementedError
102
+ name =~ /^get_/ # raise NotImplementedError
76
103
  end
77
104
 
78
105
  def has_children?
79
- raise NotImplementedError
106
+ !children_fullnames.empty?
80
107
  end
81
108
 
82
109
  def has_code_example?
83
- raise NotImplementedError
110
+ false # raise NotImplementedError
84
111
  end
85
112
 
86
113
  def has_doc?
87
- raise NotImplementedError
114
+ !undocumented?
88
115
  end
89
116
 
90
117
  def has_multiple_code_examples?
91
- raise NotImplementedError
118
+ false # raise NotImplementedError
92
119
  end
93
120
 
94
121
  def has_unconsidered_tags?
95
- raise NotImplementedError
122
+ false # raise NotImplementedError
96
123
  end
97
124
 
98
125
  def method?
99
- raise NotImplementedError
126
+ false
100
127
  end
101
128
 
102
129
  def nodoc?
103
- raise NotImplementedError
130
+ @hash['comment'] == false
104
131
  end
105
132
 
106
133
  def namespace?
107
- raise NotImplementedError
134
+ false
108
135
  end
109
136
 
110
137
  def original_docstring
111
- raise NotImplementedError
138
+ @hash['comment']
112
139
  end
113
140
 
114
141
  def overridden?
115
- raise NotImplementedError
142
+ false # raise NotImplementedError
116
143
  end
117
144
 
118
145
  def overridden_method_fullname
119
- raise NotImplementedError
146
+ nil # raise NotImplementedError
120
147
  end
121
148
 
122
149
  def parameters
123
- raise NotImplementedError
150
+ [] # raise NotImplementedError
124
151
  end
125
152
 
126
153
  def private?
127
- raise NotImplementedError
154
+ false
128
155
  end
129
156
 
130
157
  def tagged_as_internal_api?
131
- raise NotImplementedError
158
+ false
132
159
  end
133
160
 
134
161
  def tagged_as_private?
135
- raise NotImplementedError
162
+ nodoc?
136
163
  end
137
164
 
138
165
  def protected?
139
- raise NotImplementedError
166
+ false
140
167
  end
141
168
 
142
169
  def public?
143
- raise NotImplementedError
170
+ true
144
171
  end
145
172
 
146
173
  def questioning_name?
147
- raise NotImplementedError
174
+ fullname =~ /\?$/
148
175
  end
149
176
 
150
177
  def return_described?
151
- raise NotImplementedError
178
+ false # raise NotImplementedError
152
179
  end
153
180
 
154
181
  def return_mentioned?
155
- raise NotImplementedError
182
+ false # raise NotImplementedError
156
183
  end
157
184
 
158
185
  def return_typed?
159
- raise NotImplementedError
186
+ false # raise NotImplementedError
160
187
  end
161
188
 
162
189
  def in_root?
163
- raise NotImplementedError
190
+ depth == 1
164
191
  end
165
192
 
166
193
  def setter?
167
- raise NotImplementedError
194
+ name =~ /^set_/ # raise NotImplementedError
168
195
  end
169
196
 
170
197
  def source
171
- raise NotImplementedError
198
+ nil
172
199
  end
173
200
 
174
201
  def unconsidered_tag_count
175
- raise NotImplementedError
202
+ 0
176
203
  end
177
204
 
178
205
  def undocumented?
179
- raise NotImplementedError
206
+ @hash['comment'].to_s.empty?
180
207
  end
181
208
 
182
209
  def visibility
183
- raise NotImplementedError
210
+ :public
211
+ end
212
+
213
+ protected
214
+
215
+ def meta?
216
+ !meta.nil?
217
+ end
218
+
219
+ def meta
220
+ @hash['meta']
184
221
  end
185
222
  end
186
223
  end