Class: Analyst::Entities::Root

Inherits:
Entity
  • Object
show all
Defined in:
lib/analyst/entities/root.rb

Instance Attribute Summary

Attributes inherited from Entity

#ast, #parent

Instance Method Summary collapse

Methods inherited from Entity

#classes, #conditionals, #constant_assignments, #constants, #file_path, handles_node, #hashes, #initialize, #line_number, #location, #method_calls, #methods, #modules, process, #source, #strings, #top_level_classes, #top_level_constant_assignments, #top_level_constants, #top_level_modules, #variables

Constructor Details

This class inherits a constructor from Analyst::Entities::Entity

Instance Method Details

#contentsObject



17
18
19
20
21
22
# File 'lib/analyst/entities/root.rb', line 17

def contents
  @contents ||= actual_contents.map do |child|
    # skip top-level CodeBlocks
    child.is_a?(Entities::CodeBlock) ? child.contents : child
  end.flatten
end

#full_nameObject



9
10
11
# File 'lib/analyst/entities/root.rb', line 9

def full_name
  ""
end

#inspectObject



13
14
15
# File 'lib/analyst/entities/root.rb', line 13

def inspect
  "\#<#{self.class}>"
end