Class: Spells::Parser
- Inherits:
-
Object
- Object
- Spells::Parser
- Includes:
- Singleton
- Defined in:
- lib/spells/parser.rb
Instance Method Summary collapse
-
#initialize ⇒ Parser
constructor
A new instance of Parser.
- #parse(text) ⇒ Object
Constructor Details
#initialize ⇒ Parser
Returns a new instance of Parser.
5 6 7 8 9 10 |
# File 'lib/spells/parser.rb', line 5 def initialize Treetop.load File.('../../../grammar/spells/punctuation.treetop', __FILE__) Treetop.load File.('../../../grammar/spells/symbols.treetop', __FILE__) Treetop.load File.('../../../grammar/spells.treetop', __FILE__) @parser = SpellsParser.new end |
Instance Method Details
#parse(text) ⇒ Object
12 13 14 |
# File 'lib/spells/parser.rb', line 12 def parse(text) @parser.parse text end |