Class: KDL::Document
- Inherits:
-
Object
- Object
- KDL::Document
- Defined in:
- lib/kdl/document.rb
Instance Attribute Summary collapse
-
#nodes ⇒ Object
Returns the value of attribute nodes.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(nodes) ⇒ Document
constructor
A new instance of Document.
- #to_s ⇒ Object
Constructor Details
#initialize(nodes) ⇒ Document
Returns a new instance of Document.
5 6 7 |
# File 'lib/kdl/document.rb', line 5 def initialize(nodes) @nodes = nodes end |
Instance Attribute Details
#nodes ⇒ Object
Returns the value of attribute nodes.
3 4 5 |
# File 'lib/kdl/document.rb', line 3 def nodes @nodes end |
Instance Method Details
#==(other) ⇒ Object
13 14 15 16 17 |
# File 'lib/kdl/document.rb', line 13 def ==(other) return false unless other.is_a?(Document) nodes == other.nodes end |
#to_s ⇒ Object
9 10 11 |
# File 'lib/kdl/document.rb', line 9 def to_s @nodes.map(&:to_s).join("\n") + "\n" end |