Class: Analyst::Entities::File
- Inherits:
-
Entity
- Object
- Entity
- Analyst::Entities::File
show all
- Defined in:
- lib/analyst/entities/file.rb
Instance Attribute Summary
Attributes inherited from Entity
#ast, #parent
Instance Method Summary
collapse
Methods inherited from Entity
#classes, #conditionals, #constants, handles_node, #initialize, #inspect, #line_number, #location, #method_calls, #methods, #modules, #source, #top_level_classes, #top_level_constants, #top_level_modules
Instance Method Details
#contents ⇒ Object
21
22
23
24
25
26
|
# File 'lib/analyst/entities/file.rb', line 21
def contents
@contents ||= actual_contents.map do |child|
child.is_a?(Entities::CodeBlock) ? child.contents : child
end.flatten
end
|
#file_path ⇒ Object
13
14
15
|
# File 'lib/analyst/entities/file.rb', line 13
def file_path
parent.source_data_for(self)
end
|
#full_name ⇒ Object
9
10
11
|
# File 'lib/analyst/entities/file.rb', line 9
def full_name
""
end
|
#origin_source ⇒ Object
17
18
19
|
# File 'lib/analyst/entities/file.rb', line 17
def origin_source
::File.open(file_path, 'r').read
end
|