Class: Cassandra::Comparable

### Home Classes Methods

### In Files

- lib/cassandra/comparable.rb

### Parent

Object

### Methods

- #<=>
- #==
- #eql?
- #hash
- #to_s

### Files

- CHANGELOG
- LICENSE
- Makefile

### Class/Module Index

Quicksearch

- Cassandra
- Cassandra::Batch
- Cassandra::ColumnFamily
- Cassandra::Comparable
- Cassandra::Composite
- Cassandra::Consistency
- Cassandra::Constants
- Cassandra::DynamicComposite
- Cassandra::Helpers
- Cassandra::Keyspace
- Cassandra::Long
- Cassandra::Mock
- CassandraThrift
- CassandraThrift::Cassandra
- CassandraThrift::Cassandra::Client
- SimpleUUID
- SimpleUUID::UUID
- Array
- Time

No matching classes.

# Cassandra::Comparable

Abstract base class for comparable numeric column name types

### Public Instance Methods

<=>(other) click to toggle source

    # File lib/cassandra/comparable.rb, line 8
    def <=>(other)
      self.to_i <=> other.to_i
    end

==(other) click to toggle source

    # File lib/cassandra/comparable.rb, line 20
    def ==(other)
      other.respond_to?(:to_i) && self.to_i == other.to_i
    end

eql?(other) click to toggle source

    # File lib/cassandra/comparable.rb, line 16
    def eql?(other)
      other.is_a?(Comparable) and @bytes == other.to_s
    end

hash() click to toggle source

    # File lib/cassandra/comparable.rb, line 12
    def hash
      @bytes.hash
    end

to_s() click to toggle source

    # File lib/cassandra/comparable.rb, line 24
    def to_s
      @bytes
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.