Class: Packcr::Tokenizer::LrAnswerTable
- Inherits:
-
Object
- Object
- Packcr::Tokenizer::LrAnswerTable
- Defined in:
- lib/packcr/tokenizer.rb
Instance Method Summary collapse
- #[](index, rule_name) ⇒ Object
- #[]=(index, rule_name, answer) ⇒ Object
- #clear ⇒ Object
-
#initialize ⇒ LrAnswerTable
constructor
A new instance of LrAnswerTable.
Constructor Details
#initialize ⇒ LrAnswerTable
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 |
#clear ⇒ Object
2812 2813 2814 |
# File 'lib/packcr/tokenizer.rb', line 2812 def clear @answers.clear end |