Class: RubyDetective::AST::Nodes::ValueNode

Inherits:
GenericNode
  • Object
show all
Defined in:
lib/ruby_detective/ast/nodes/value_node.rb

Instance Attribute Summary collapse

Attributes inherited from GenericNode

#ast_node, #children, #file_path, #parent_node

Instance Method Summary collapse

Methods inherited from GenericNode

#absolute_path_sign_node?, #class_declaration_node?, #constant_reference_node?, #declared_namespace, #generic_node?, #module_declaration_node?, #namespace, #query, #short_namespace, #value_node?

Constructor Details

#initialize(value, *args) ⇒ ValueNode

Returns a new instance of ValueNode.



7
8
9
10
# File 'lib/ruby_detective/ast/nodes/value_node.rb', line 7

def initialize(value, *args)
  super(value, *args)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



5
6
7
# File 'lib/ruby_detective/ast/nodes/value_node.rb', line 5

def value
  @value
end

Instance Method Details

#first_lineObject



16
17
18
# File 'lib/ruby_detective/ast/nodes/value_node.rb', line 16

def first_line
  parent_node.first_line
end

#last_lineObject



20
21
22
# File 'lib/ruby_detective/ast/nodes/value_node.rb', line 20

def last_line
  parent_node.last_line
end

#raw_childrenObject



24
25
26
# File 'lib/ruby_detective/ast/nodes/value_node.rb', line 24

def raw_children
  []
end

#typeObject



12
13
14
# File 'lib/ruby_detective/ast/nodes/value_node.rb', line 12

def type
  :value
end