Class: Cassandra::Column
- Inherits:
-
Object
- Object
- Cassandra::Column
- Defined in:
- lib/cassandra/column.rb
Overview
Represents a cassandra column
Instance Attribute Summary collapse
-
#name ⇒ String
readonly
Column name.
-
#order ⇒ Symbol
readonly
Column order (
:asc
or:desc
). -
#type ⇒ Cassandra::Type
readonly
Column type.
Instance Method Summary collapse
-
#eql?(other) ⇒ Boolean
(also: #==)
Whether this column is equal to the other.
-
#frozen? ⇒ Boolean
Whether the column is frozen.
-
#inspect ⇒ String
A CLI-friendly column representation.
-
#static? ⇒ Boolean
Whether the column is static.
Instance Attribute Details
#name ⇒ String (readonly)
Returns column name.
39 40 41 |
# File 'lib/cassandra/column.rb', line 39 def name @name end |
#order ⇒ Symbol (readonly)
Returns column order (:asc
or :desc
).
43 44 45 |
# File 'lib/cassandra/column.rb', line 43 def order @order end |
#type ⇒ Cassandra::Type (readonly)
Returns column type.
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.
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.
64 65 66 |
# File 'lib/cassandra/column.rb', line 64 def frozen? @frozen end |
#inspect ⇒ String
Returns 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.
59 60 61 |
# File 'lib/cassandra/column.rb', line 59 def static? @static end |