Class: Packcr::Parser::ThunkNode

Inherits:
Object
  • Object
show all
Defined in:
lib/packcr/parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(thunks, values, index) ⇒ ThunkNode

Returns a new instance of ThunkNode.



4852
4853
4854
4855
4856
4857
# File 'lib/packcr/parser.rb', line 4852

def initialize(thunks, values, index)
  @thunks = thunks
  @values = values
  @index = index
  values[index] ||= Value.new if values
end

Instance Attribute Details

#indexObject

Returns the value of attribute index.



4850
4851
4852
# File 'lib/packcr/parser.rb', line 4850

def index
  @index
end

#thunksObject

Returns the value of attribute thunks.



4850
4851
4852
# File 'lib/packcr/parser.rb', line 4850

def thunks
  @thunks
end

#valuesObject

Returns the value of attribute values.



4850
4851
4852
# File 'lib/packcr/parser.rb', line 4850

def values
  @values
end

Instance Method Details

#clearObject



4865
4866
4867
# File 'lib/packcr/parser.rb', line 4865

def clear
  @thunks.clear
end

#do_action(ctx, _values, _index) ⇒ Object



4859
4860
4861
4862
4863
# File 'lib/packcr/parser.rb', line 4859

def do_action(ctx, _values, _index)
  @thunks.each do |thunk|
    thunk.do_action(ctx, @values, @index)
  end
end