Class: Inch::Language::Elixir::CodeObject::Base
Instance Attribute Summary
#object_lookup
Instance Method Summary
collapse
#[], for, #initialize, #inspect, #marshal_dump, #marshal_load
Instance Method Details
#alias? ⇒ Boolean
Returns if the current object is an alias for something else.
19
20
21
|
# File 'lib/inch/language/elixir/code_object/base.rb', line 19
def alias?
!aliased_object.nil?
end
|
Returns the object the current object is an alias of.
25
26
27
|
# File 'lib/inch/language/elixir/code_object/base.rb', line 25
def aliased_object
object_lookup.find(self[:aliased_object_fullname])
end
|
#api_tag? ⇒ Boolean
Returns true
if the object has an @api tag.
30
31
32
|
# File 'lib/inch/language/elixir/code_object/base.rb', line 30
def api_tag?
self[:api_tag?]
end
|
#children ⇒ Array
Returns the children of the current object.
35
36
37
38
39
|
# File 'lib/inch/language/elixir/code_object/base.rb', line 35
def children
@children ||= self[:children_fullnames].map do |fullname|
object_lookup.find(fullname)
end
end
|
#constant? ⇒ Boolean
Returns true
if the object represents a constant.
42
43
44
|
# File 'lib/inch/language/elixir/code_object/base.rb', line 42
def constant?
self[:constant?]
end
|
#core? ⇒ Boolean
46
47
48
|
# File 'lib/inch/language/elixir/code_object/base.rb', line 46
def core?
self[:core?]
end
|
#depth ⇒ Fixnum
Note:
top-level counts, that’s why Foo has depth 1!
The depth of the following is 4:
Foo::Bar::Baz#initialize
^ ^ ^ ^
1 << 2 << 3 << 4
depth
answers the question “how many layers of code objects are above this one?”
62
63
64
|
# File 'lib/inch/language/elixir/code_object/base.rb', line 62
def depth
self[:depth]
end
|
#docstring ⇒ Docstring
67
68
69
|
# File 'lib/inch/language/elixir/code_object/base.rb', line 67
def docstring
self[:docstring]
end
|
#filename ⇒ String
Returns the name of the file where the object is declared first
77
78
79
80
81
|
# File 'lib/inch/language/elixir/code_object/base.rb', line 77
def filename
files.first
end
|
#files ⇒ Object
71
72
73
|
# File 'lib/inch/language/elixir/code_object/base.rb', line 71
def files
self[:files]
end
|
#fullname ⇒ String
Returns the fully qualified name of an object, e.g. “Inch::CodeObject::Provider::YARD::Docstring”.
91
92
93
|
# File 'lib/inch/language/elixir/code_object/base.rb', line 91
def fullname
self[:fullname]
end
|
#has_alias? ⇒ Boolean
95
96
97
|
# File 'lib/inch/language/elixir/code_object/base.rb', line 95
def has_alias?
!self[:aliases_fullnames].empty?
end
|
#has_children? ⇒ Boolean
99
100
101
|
# File 'lib/inch/language/elixir/code_object/base.rb', line 99
def has_children?
self[:has_children?]
end
|
#has_code_example? ⇒ Boolean
103
104
105
|
# File 'lib/inch/language/elixir/code_object/base.rb', line 103
def has_code_example?
self[:has_code_example?]
end
|
#has_doc? ⇒ Boolean
107
108
109
|
# File 'lib/inch/language/elixir/code_object/base.rb', line 107
def has_doc?
self[:has_doc?]
end
|
#has_multiple_code_examples? ⇒ Boolean
111
112
113
|
# File 'lib/inch/language/elixir/code_object/base.rb', line 111
def has_multiple_code_examples?
self[:has_multiple_code_examples?]
end
|
115
116
117
|
# File 'lib/inch/language/elixir/code_object/base.rb', line 115
def has_unconsidered_tags?
self[:has_unconsidered_tags?]
end
|
#in_root? ⇒ Boolean
119
120
121
|
# File 'lib/inch/language/elixir/code_object/base.rb', line 119
def in_root?
self[:in_root?]
end
|
#language ⇒ Object
13
14
15
|
# File 'lib/inch/language/elixir/code_object/base.rb', line 13
def language
:elixir
end
|
#method? ⇒ Boolean
Returns true
if the object represents a method.
124
125
126
|
# File 'lib/inch/language/elixir/code_object/base.rb', line 124
def method?
self[:method?]
end
|
#name ⇒ String
Returns the name of an object, e.g. “Docstring”.
85
86
87
|
# File 'lib/inch/language/elixir/code_object/base.rb', line 85
def name
self[:name]
end
|
#namespace? ⇒ Boolean
Returns true
if the object represents a namespace.
129
130
131
|
# File 'lib/inch/language/elixir/code_object/base.rb', line 129
def namespace?
self[:namespace?]
end
|
#nodoc? ⇒ Boolean
Returns true
if the object was tagged not to be documented.
139
140
141
|
# File 'lib/inch/language/elixir/code_object/base.rb', line 139
def nodoc?
self[:nodoc?]
end
|
#original_docstring ⇒ Object
133
134
135
|
# File 'lib/inch/language/elixir/code_object/base.rb', line 133
def original_docstring
self[:original_docstring]
end
|
Returns the parent of the current object or nil
.
145
146
147
|
# File 'lib/inch/language/elixir/code_object/base.rb', line 145
def parent
object_lookup.find(self[:parent_fullname])
end
|
#private? ⇒ Boolean
149
150
151
|
# File 'lib/inch/language/elixir/code_object/base.rb', line 149
def private?
self[:private?]
end
|
#protected? ⇒ Boolean
166
167
168
|
# File 'lib/inch/language/elixir/code_object/base.rb', line 166
def protected?
self[:protected?]
end
|
#public? ⇒ Boolean
170
171
172
|
# File 'lib/inch/language/elixir/code_object/base.rb', line 170
def public?
self[:public?]
end
|
#source ⇒ Object
174
175
176
|
# File 'lib/inch/language/elixir/code_object/base.rb', line 174
def source
self[:source]
end
|
#tagged_as_internal_api? ⇒ Boolean
Returns true
if the object or its parent is tagged as part of an internal api.
162
163
164
|
# File 'lib/inch/language/elixir/code_object/base.rb', line 162
def tagged_as_internal_api?
self[:tagged_as_internal_api?]
end
|
#tagged_as_private? ⇒ Boolean
Returns true
if the object or its parent is tagged as @private.
155
156
157
|
# File 'lib/inch/language/elixir/code_object/base.rb', line 155
def tagged_as_private?
self[:tagged_as_private?]
end
|
#type ⇒ Object
178
179
180
|
# File 'lib/inch/language/elixir/code_object/base.rb', line 178
def type
self.class.to_s.gsub(/Object$/, '')
end
|
#unconsidered_tag_count ⇒ Fixnum
Returns the amount of tags not considered for this object.
188
189
190
|
# File 'lib/inch/language/elixir/code_object/base.rb', line 188
def unconsidered_tag_count
self[:unconsidered_tag_count]
end
|
#undocumented? ⇒ Boolean
Returns true
if the object has no documentation at all.
183
184
185
|
# File 'lib/inch/language/elixir/code_object/base.rb', line 183
def undocumented?
self[:undocumented?]
end
|
#visibility ⇒ Object
192
193
194
|
# File 'lib/inch/language/elixir/code_object/base.rb', line 192
def visibility
self[:visibility]
end
|