Sha256: 008887a0ab7157172ce838501706e05707d0caffb9a3e857612095110a358c0c

Contents?: true

Size: 645 Bytes

Versions: 12

Compression:

Stored size: 645 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] 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 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

12 entries across 12 versions & 1 rubygems

Version Path
ox-1.2.5 lib/ox/node.rb
ox-1.2.4 lib/ox/node.rb
ox-1.2.3 lib/ox/node.rb
ox-1.2.2 lib/ox/node.rb
ox-1.2.1 lib/ox/node.rb
ox-1.2.0 lib/ox/node.rb
ox-1.1.1 lib/ox/node.rb
ox-1.1.0 lib/ox/node.rb
ox-1.0.3 lib/ox/node.rb
ox-1.0.2 lib/ox/node.rb
ox-1.0.1 lib/ox/node.rb
ox-1.0.0 lib/ox/node.rb