Class: Packcr::Parser::ThunkNode

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(thunks, values, index) ⇒ ThunkNode



4507
4508
4509
4510
4511
4512
# File 'lib/packcr/parser.rb', line 4507

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.



4505
4506
4507
# File 'lib/packcr/parser.rb', line 4505

def index
  @index
end

#thunksObject

Returns the value of attribute thunks.



4505
4506
4507
# File 'lib/packcr/parser.rb', line 4505

def thunks
  @thunks
end

#valuesObject

Returns the value of attribute values.



4505
4506
4507
# File 'lib/packcr/parser.rb', line 4505

def values
  @values
end

Instance Method Details

#clearObject



4520
4521
4522
# File 'lib/packcr/parser.rb', line 4520

def clear
  @thunks.clear
end

#do_action(ctx, _values, _index) ⇒ Object



4514
4515
4516
4517
4518
# File 'lib/packcr/parser.rb', line 4514

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