Sha256: ab5c26d570e3817c20fcfe382ae82fe67740663a4394e4bd55aacd8d0a526959

Contents?: true

Size: 487 Bytes

Versions: 49

Compression:

Stored size: 487 Bytes

Contents

class Cassandra
  # Abstract base class for comparable numeric column name types
  class Comparable
    class TypeError < ::TypeError #:nodoc:
    end
  
    def <=>(other)
      self.to_i <=> other.to_i
    end
    
    def hash
      @bytes.hash
    end
    
    def eql?(other)
      other.is_a?(Comparable) and @bytes == other.to_s
    end    
    
    def ==(other)
      other.respond_to?(:to_i) && self.to_i == other.to_i
    end
    
    def to_s
      @bytes
    end
  end
end

Version data entries

49 entries across 49 versions & 7 rubygems

Version Path
sessionm-cassandra-1.1.2 lib/cassandra/comparable.rb
sessionm-cassandra-1.1.1 lib/cassandra/comparable.rb
sessionm-cassandra-1.1.0 lib/cassandra/comparable.rb
cassandra-0.23.0 lib/cassandra/comparable.rb
cassandra-0.22.0 lib/cassandra/comparable.rb
cassandra-mavericks-0.21.1 lib/cassandra/comparable.rb
cassandra-0.21.0 lib/cassandra/comparable.rb
cassandra-0.20.0 lib/cassandra/comparable.rb
cassandra-0.19.0 lib/cassandra/comparable.rb
sessionm-cassandra-1.0.2 lib/cassandra/comparable.rb
cassandra-0.18.0 lib/cassandra/comparable.rb
sessionm-cassandra-1.0.1 lib/cassandra/comparable.rb
sessionm-cassandra-1.0.0 lib/cassandra/comparable.rb
cassandra-0.17.0 lib/cassandra/comparable.rb
cassandra-0.16.0 lib/cassandra/comparable.rb
cassandra-0.15.0 lib/cassandra/comparable.rb
cassandra-0.14.0 lib/cassandra/comparable.rb
cassandra-0.13.0 lib/cassandra/comparable.rb
hallelujah-cassandra-0.12.3 lib/cassandra/comparable.rb
mcmire-cassandra-0.12.3 lib/cassandra/comparable.rb