Class: Halunke::UnassignedNode

Inherits:
Struct
  • Object
show all
Defined in:
lib/halunke/nodes.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nodeObject

Returns the value of attribute node

Returns:

  • (Object)

    the current value of node



61
62
63
# File 'lib/halunke/nodes.rb', line 61

def node
  @node
end

#teObject

Returns the value of attribute te

Returns:

  • (Object)

    the current value of te



61
62
63
# File 'lib/halunke/nodes.rb', line 61

def te
  @te
end

#tsObject

Returns the value of attribute ts

Returns:

  • (Object)

    the current value of ts



61
62
63
# File 'lib/halunke/nodes.rb', line 61

def ts
  @ts
end

Instance Method Details

#==(other) ⇒ Object



66
67
68
69
# File 'lib/halunke/nodes.rb', line 66

def ==(other)
  other.is_a?(UnassignedNode) &&
    node == other.node
end

#eval(context) ⇒ Object



62
63
64
# File 'lib/halunke/nodes.rb', line 62

def eval(context)
  context["UnassignedBareword"].create_instance(node.value, source_code_position: source_code_position)
end

#source_code_positionObject



71
72
73
# File 'lib/halunke/nodes.rb', line 71

def source_code_position
  SourceCodePosition.new(ts, te)
end