Sha256: 2efffc6735e00c29e8a7941dd98a250b22edf987826c1092b1a08793554f44d0

Contents?: true

Size: 683 Bytes

Versions: 36

Compression:

Stored size: 683 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 == @value
    end
    alias == eql?

  end # Node
end # Ox

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
ox-1.6.2 lib/ox/node.rb
ox-1.6.1 lib/ox/node.rb
ox-1.6.0 lib/ox/node.rb
ox-1.5.9 lib/ox/node.rb
ox-1.5.8 lib/ox/node.rb
ox-1.5.7 lib/ox/node.rb
ox-1.5.6 lib/ox/node.rb
ox-1.5.5 lib/ox/node.rb
ox-1.5.4 lib/ox/node.rb
ox-1.5.3 lib/ox/node.rb
ox-1.5.2 lib/ox/node.rb
ox-1.5.1 lib/ox/node.rb
ox-1.5.0 lib/ox/node.rb
ox-1.4.6 lib/ox/node.rb
ox-1.4.5 lib/ox/node.rb
ox-1.4.4 lib/ox/node.rb
ox-1.4.3 lib/ox/node.rb
ox-1.4.2 lib/ox/node.rb
ox-1.4.1 lib/ox/node.rb
ox-1.4.0 lib/ox/node.rb