Class: ORB::Document
- Inherits:
-
Object
- Object
- ORB::Document
- Defined in:
- lib/orb/document.rb
Instance Attribute Summary collapse
-
#root ⇒ Object
readonly
Returns the value of attribute root.
Instance Method Summary collapse
-
#initialize(tokens) ⇒ Document
constructor
A new instance of Document.
- #parse(tokens) ⇒ Object
- #render(context) ⇒ Object
Constructor Details
#initialize(tokens) ⇒ Document
7 8 9 |
# File 'lib/orb/document.rb', line 7 def initialize(tokens) parse(tokens) end |
Instance Attribute Details
#root ⇒ Object (readonly)
Returns the value of attribute root.
5 6 7 |
# File 'lib/orb/document.rb', line 5 def root @root end |
Instance Method Details
#parse(tokens) ⇒ Object
11 12 13 |
# File 'lib/orb/document.rb', line 11 def parse(tokens) @root ||= Parser.parse(tokens) end |
#render(context) ⇒ Object
15 16 17 |
# File 'lib/orb/document.rb', line 15 def render(context) @root.render(context) end |