Class: Cassandra::Column

Inherits:
Object
  • Object
show all
Defined in:
lib/cassandra/column.rb

Overview

Represents a cassandra column

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameString (readonly)

Returns column name.

Returns:

  • (String)

    column name



39
40
41
# File 'lib/cassandra/column.rb', line 39

def name
  @name
end

#orderSymbol (readonly)

Returns column order (:asc or :desc).

Returns:

  • (Symbol)

    column order (:asc or :desc)



43
44
45
# File 'lib/cassandra/column.rb', line 43

def order
  @order
end

#typeCassandra::Type (readonly)

Returns column type.

Returns:



41
42
43
# File 'lib/cassandra/column.rb', line 41

def type
  @type
end

Instance Method Details

#eql?(other) ⇒ Boolean Also known as: ==

Returns whether this column is equal to the other.

Returns:

  • (Boolean)

    whether this column is equal to the other



74
75
76
77
78
79
80
81
82
# File 'lib/cassandra/column.rb', line 74

def eql?(other)
  other.is_a?(Column) &&
    @name == other.name &&
    @type == other.type &&
    @order == other.order &&
    @index == other.index &&
    @static == other.static? &&
    @frozen == other.frozen?
end

#frozen?Boolean

Returns whether the column is frozen.

Returns:

  • (Boolean)

    whether the column is frozen



64
65
66
# File 'lib/cassandra/column.rb', line 64

def frozen?
  @frozen
end

#inspectString

Returns a CLI-friendly column representation.

Returns:

  • (String)

    a CLI-friendly column representation



69
70
71
# File 'lib/cassandra/column.rb', line 69

def inspect
  "#<#{self.class.name}:0x#{self.object_id.to_s(16)} @name=#{@name} @type=#{@type}>"
end

#static?Boolean

Returns whether the column is static.

Returns:

  • (Boolean)

    whether the column is static



59
60
61
# File 'lib/cassandra/column.rb', line 59

def static?
  @static
end