Class: Packcr::Tokenizer::LrAnswerTable

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

Instance Method Summary collapse

Constructor Details

#initializeLrAnswerTable

Returns a new instance of LrAnswerTable.



2808
2809
2810
# File 'lib/packcr/tokenizer.rb', line 2808

def initialize
  @answers = {}
end

Instance Method Details

#[](index, rule_name) ⇒ Object



2821
2822
2823
# File 'lib/packcr/tokenizer.rb', line 2821

def [](index, rule_name)
  @answers.dig(index, rule_name)
end

#[]=(index, rule_name, answer) ⇒ Object



2816
2817
2818
2819
# File 'lib/packcr/tokenizer.rb', line 2816

def []=(index, rule_name, answer)
  entry = @answers[index] ||= {}
  entry[rule_name] = answer
end

#clearObject



2812
2813
2814
# File 'lib/packcr/tokenizer.rb', line 2812

def clear
  @answers.clear
end