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


195
196
197
198
# File 'lib/cequel/schema/column.rb', line 195

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


189
190
191
# File 'lib/cequel/schema/column.rb', line 189

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


203
204
205
# File 'lib/cequel/schema/column.rb', line 203

def indexed?
  !!@index_name
end