Class: Analyst::Entities::VariableAssignment

Inherits:
Entity
  • Object
show all
Defined in:
lib/analyst/entities/variable_assignment.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, #inspect, #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

#full_nameObject



12
13
14
# File 'lib/analyst/entities/variable_assignment.rb', line 12

def full_name
  (scope.nil? ? parent.full_name : scope.full_name) + '::' + name
end

#nameObject



8
9
10
# File 'lib/analyst/entities/variable_assignment.rb', line 8

def name
  name_node.to_s
end

#scopeObject



16
17
18
# File 'lib/analyst/entities/variable_assignment.rb', line 16

def scope
  @scope ||= process_node(ast.children.first)
end

#valueObject



20
21
22
# File 'lib/analyst/entities/variable_assignment.rb', line 20

def value
  @value ||= process_nodes(ast.children)
end