Class: Eggnog::Node
- Inherits:
-
Struct
- Object
- Struct
- Eggnog::Node
- Defined in:
- lib/eggnog/node.rb
Constant Summary collapse
- CONTENT_ROOT =
"__content__".freeze
Instance Attribute Summary collapse
-
#node ⇒ Object
Returns the value of attribute node.
-
#options ⇒ Object
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *args, &block) ⇒ Object (private)
78 79 80 |
# File 'lib/eggnog/node.rb', line 78 def method_missing(m, *args, &block) node.send(m, *args, &block) end |
Instance Attribute Details
#node ⇒ Object
Returns the value of attribute node
1 2 3 |
# File 'lib/eggnog/node.rb', line 1 def node @node end |
#options ⇒ Object
Returns the value of attribute options
1 2 3 |
# File 'lib/eggnog/node.rb', line 1 def @options end |
Class Method Details
.to_hash(node, options = {}) ⇒ Object
5 6 7 |
# File 'lib/eggnog/node.rb', line 5 def self.to_hash(node, = {}) new(node, ).to_hash end |
Instance Method Details
#to_hash(parent_hash = {}) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/eggnog/node.rb', line 9 def to_hash(parent_hash = {}) case node when Nokogiri::XML::Document self.class.to_hash(node.root, ) else insert_into_parent_hash(parent_hash, collect_nodes) end end |