Class: Cequel::Schema::DataColumn

Inherits:
Column
  • Object
show all
Defined in:
lib/cequel/schema/column.rb

Overview

A scalar data column

Since:

  • 1.0.0

Instance Attribute Summary collapse

Attributes inherited from Column

#name, #type

Instance Method Summary collapse

Methods inherited from Column

#==, #cast, #clustering_column?, #collection_column?, #data_column?, #inspect, #key?, #partition_key?, #to_cql, #to_s, #type?

Constructor Details

#initialize(name, type, index_name = nil) ⇒ DataColumn

Returns a new instance of DataColumn.

Parameters:

  • index_name (Symbol) (defaults to: nil)

    name this column’s secondary index

  • name (Symbol)

    the name of the column

  • type (Type)

    the type of the column

Since:

  • 1.0.0



185
186
187
188
# File 'lib/cequel/schema/column.rb', line 185

def initialize(name, type, index_name = nil)
  super(name, type)
  @index_name = index_name
end

Instance Attribute Details

#index_nameSymbol (readonly)

Returns name of the secondary index applied to this column, if any.

Returns:

  • (Symbol)

    name of the secondary index applied to this column, if any

Since:

  • 1.0.0



179
180
181
# File 'lib/cequel/schema/column.rb', line 179

def index_name
  @index_name
end

Instance Method Details

#indexed?Boolean

Returns true if this column has a secondary index.

Returns:

  • (Boolean)

    true if this column has a secondary index

Since:

  • 1.0.0



193
194
195
# File 'lib/cequel/schema/column.rb', line 193

def indexed?
  !!@index_name
end