Sha256: 085b62de48a75645ec82fd1d979421548b277d050ed1b1e3528eda2e44834dd2

Contents?: true

Size: 687 Bytes

Versions: 51

Compression:

Stored size: 687 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.
    # @param [String] value 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.
    # @param [Object] other Object to compare _self_ to.
    def eql?(other)
      return false if (other.nil? or self.class != other.class)
      other.value == self.value
    end
    alias == eql?

  end # Node
end # Ox

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
ox-2.3.0 lib/ox/node.rb
ox-2.2.4 lib/ox/node.rb
ox-2.2.3 lib/ox/node.rb
ox-2.2.2 lib/ox/node.rb
ox-2.2.1 lib/ox/node.rb
ox-2.2.0 lib/ox/node.rb
ox-2.1.8 lib/ox/node.rb
ox-2.1.7 lib/ox/node.rb
ox-2.1.6 lib/ox/node.rb
ox-2.1.5 lib/ox/node.rb
ox-2.1.4 lib/ox/node.rb
ox-2.1.3 lib/ox/node.rb
ox-2.1.2 lib/ox/node.rb
ox-2.1.1 lib/ox/node.rb
ox-2.1.0 lib/ox/node.rb
ox-2.0.12 lib/ox/node.rb
ox-2.0.11 lib/ox/node.rb
ox-2.0.9 lib/ox/node.rb
ox-2.0.8 lib/ox/node.rb
ox-2.0.7 lib/ox/node.rb