Class: Temple::Mixins::GrammarDSL::Rule Private
- Defined in:
- lib/temple/mixins/grammar_dsl.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
- #copy_to(grammar) ⇒ Object private
-
#initialize(grammar) ⇒ Rule
constructor
private
A new instance of Rule.
- #match?(exp) ⇒ Boolean (also: #===, #=~) private
- #|(rule) ⇒ Object private
Constructor Details
#initialize(grammar) ⇒ Rule
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Rule.
7 8 9 |
# File 'lib/temple/mixins/grammar_dsl.rb', line 7 def initialize(grammar) @grammar = grammar end |
Instance Method Details
#copy_to(grammar) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
21 22 23 24 25 |
# File 'lib/temple/mixins/grammar_dsl.rb', line 21 def copy_to(grammar) copy = dup.instance_eval { @grammar = grammar; self } copy.after_copy(self) if copy.respond_to?(:after_copy) copy end |
#match?(exp) ⇒ Boolean Also known as: ===, =~
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
11 12 13 |
# File 'lib/temple/mixins/grammar_dsl.rb', line 11 def match?(exp) match(exp, []) end |