Class: Ox::Node
- Inherits:
-
Object
- Object
- Ox::Node
- Defined in:
- lib/ox/node.rb
Overview
The Node is the base class for all other in the Ox module.
Instance Attribute Summary collapse
-
#value ⇒ Object
String value associated with the Node.
Instance Method Summary collapse
-
#eql?(other) ⇒ Boolean
(also: #==)
Returns true if this Object and other are of the same type and have the equivalent value otherwise false is returned.
-
#initialize(value) ⇒ Node
constructor
Creates a new Node with the specified String value.
Constructor Details
#initialize(value) ⇒ Node
Creates a new Node with the specified String value.
-
value
[String] string value for the Node
10 11 12 |
# File 'lib/ox/node.rb', line 10 def initialize(value) @value = value.to_s end |
Instance Attribute Details
#value ⇒ Object
String value associated with the Node.
6 7 8 |
# File 'lib/ox/node.rb', line 6 def value @value end |
Instance Method Details
#eql?(other) ⇒ Boolean Also known as: ==
Returns true if this Object and other are of the same type and have the equivalent value otherwise false is returned.
-
other
[Object] Object to compare self to.
17 18 19 20 |
# File 'lib/ox/node.rb', line 17 def eql?(other) return false if (other.nil? or self.class != other.class) other.value == self.value end |