Sha256: 2338a5941cb5d7611ba7ed940b1d5d0bfa3cc83e4ad082fe27f4d7228715a30a

Contents?: true

Size: 671 Bytes

Versions: 7

Compression:

Stored size: 671 Bytes

Contents

module Ox
  # The Node is the base class for all other in the Ox module.
  class Node
    # String value associated with the Node.
    attr_accessor :value

    # Creates a new Node with the specified String value.
    # - +value+ [String] string value for the Node
    def initialize(value)
      @value = value.to_s
    end

    # 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.
    def eql?(other)
      return false if (other.nil? or self.class != other.class)

      other.value == value
    end
    alias == eql?
  end # Node
end # Ox

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ox-2.14.21 lib/ox/node.rb
ox-2.14.20 lib/ox/node.rb
ox-2.14.19 lib/ox/node.rb
ox-2.14.18 lib/ox/node.rb
ox-2.14.17 lib/ox/node.rb
ox-2.14.16 lib/ox/node.rb
ox-2.14.15 lib/ox/node.rb