Class: Inch::Language::Elixir::CodeObject::Base

Inherits:
CodeObject::Proxy show all
Defined in:
lib/inch/language/elixir/code_object/base.rb

Direct Known Subclasses

FunctionObject, ModuleObject, TypeObject

Instance Attribute Summary

Attributes inherited from CodeObject::Proxy

#object_lookup

Instance Method Summary collapse

Methods inherited from CodeObject::Proxy

#[], for, #initialize, #inspect, #marshal_dump, #marshal_load

Constructor Details

This class inherits a constructor from Inch::CodeObject::Proxy

Instance Method Details

#alias?Boolean


19
20
21
# File 'lib/inch/language/elixir/code_object/base.rb', line 19

def alias?
  !aliased_object.nil?
end

#aliased_objectCodeObject::Proxy


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


30
31
32
# File 'lib/inch/language/elixir/code_object/base.rb', line 30

def api_tag?
  self[:api_tag?]
end

#childrenArray


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


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

#depthFixnum

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

#docstringDocstring


67
68
69
# File 'lib/inch/language/elixir/code_object/base.rb', line 67

def docstring
  self[:docstring]
end

#filenameString

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
  # just checking the first file (which is the file where an object
  # is first declared)
  files.first
end

#filesObject


71
72
73
# File 'lib/inch/language/elixir/code_object/base.rb', line 71

def files
  self[:files]
end

#fullnameString


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

#has_unconsidered_tags?Boolean


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

#languageObject


13
14
15
# File 'lib/inch/language/elixir/code_object/base.rb', line 13

def language
  :elixir
end

#method?Boolean


124
125
126
# File 'lib/inch/language/elixir/code_object/base.rb', line 124

def method?
  self[:method?]
end

#nameString


85
86
87
# File 'lib/inch/language/elixir/code_object/base.rb', line 85

def name
  self[:name]
end

#namespace?Boolean


129
130
131
# File 'lib/inch/language/elixir/code_object/base.rb', line 129

def namespace?
  self[:namespace?]
end

#nodoc?Boolean


139
140
141
# File 'lib/inch/language/elixir/code_object/base.rb', line 139

def nodoc?
  self[:nodoc?]
end

#original_docstringObject


133
134
135
# File 'lib/inch/language/elixir/code_object/base.rb', line 133

def original_docstring
  self[:original_docstring]
end

#parentCodeObject::Proxy?


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

#sourceObject


174
175
176
# File 'lib/inch/language/elixir/code_object/base.rb', line 174

def source
  self[:source]
end

#tagged_as_internal_api?Boolean


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


155
156
157
# File 'lib/inch/language/elixir/code_object/base.rb', line 155

def tagged_as_private?
  self[:tagged_as_private?]
end

#typeObject


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_countFixnum


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


183
184
185
# File 'lib/inch/language/elixir/code_object/base.rb', line 183

def undocumented?
  self[:undocumented?]
end

#visibilityObject


192
193
194
# File 'lib/inch/language/elixir/code_object/base.rb', line 192

def visibility
  self[:visibility]
end