Class: Ref
- Inherits:
-
Combinator
- Object
- Combinator
- Ref
- Defined in:
- lib/hivemind/combinators.rb
Instance Attribute Summary collapse
-
#label ⇒ Object
Returns the value of attribute label.
Instance Method Summary collapse
-
#initialize(label, as: nil) ⇒ Ref
constructor
A new instance of Ref.
- #parse(input, refs) ⇒ Object
Methods inherited from Combinator
Constructor Details
#initialize(label, as: nil) ⇒ Ref
Returns a new instance of Ref.
145 146 147 148 |
# File 'lib/hivemind/combinators.rb', line 145 def initialize(label, as: nil) @label = label @as = as end |
Instance Attribute Details
#label ⇒ Object
Returns the value of attribute label.
143 144 145 |
# File 'lib/hivemind/combinators.rb', line 143 def label @label end |
Instance Method Details
#parse(input, refs) ⇒ Object
150 151 152 153 |
# File 'lib/hivemind/combinators.rb', line 150 def parse(input, refs) ref_parser = refs[@label.to_sym] ref_parser.parse(input, refs) end |