Class: SelfML::Document
- Inherits:
-
Object
- Object
- SelfML::Document
- Defined in:
- lib/self-ml.rb
Overview
Instance Method Summary collapse
-
#initialize ⇒ Document
constructor
Create a new document object, with which, you can parse SelfML documents.
-
#parse(string) ⇒ Object
Parse a string of SelfML.
Constructor Details
#initialize ⇒ Document
Create a new document object, with which, you can parse SelfML documents.
34 35 36 37 |
# File 'lib/self-ml.rb', line 34 def initialize @parser = Parser.new @transformer = Transformer.new end |
Instance Method Details
#parse(string) ⇒ Object
Parse a string of SelfML. See SelfML#parse for more information on SelfML parsing.
41 42 43 |
# File 'lib/self-ml.rb', line 41 def parse(string) @transformer.apply(@parser.parse(string)) end |