Class: Pricecut::Elements::Element
- Inherits:
-
Object
- Object
- Pricecut::Elements::Element
- Defined in:
- lib/pricecut/elements/element.rb
Instance Attribute Summary collapse
-
#node ⇒ Object
Returns the value of attribute node.
-
#visitor ⇒ Object
Returns the value of attribute visitor.
Instance Method Summary collapse
- #append_newline ⇒ Object (also: #eol)
- #append_output(text) ⇒ Object (also: #p)
-
#initialize(visitor, node) ⇒ Element
constructor
A new instance of Element.
- #yield_children ⇒ Object
Constructor Details
#initialize(visitor, node) ⇒ Element
Returns a new instance of Element.
6 7 8 9 |
# File 'lib/pricecut/elements/element.rb', line 6 def initialize(visitor, node) @visitor = visitor @node = node end |
Instance Attribute Details
#node ⇒ Object
Returns the value of attribute node.
4 5 6 |
# File 'lib/pricecut/elements/element.rb', line 4 def node @node end |
#visitor ⇒ Object
Returns the value of attribute visitor.
4 5 6 |
# File 'lib/pricecut/elements/element.rb', line 4 def visitor @visitor end |
Instance Method Details
#append_newline ⇒ Object Also known as: eol
11 12 13 |
# File 'lib/pricecut/elements/element.rb', line 11 def append_newline append_output("\n") end |
#append_output(text) ⇒ Object Also known as: p
17 18 19 |
# File 'lib/pricecut/elements/element.rb', line 17 def append_output(text) visitor.append_output(text) end |
#yield_children ⇒ Object
23 24 25 |
# File 'lib/pricecut/elements/element.rb', line 23 def yield_children visitor.visit_children(node) end |