Class: CassandraModel::DataInquirer::ColumnDefault

Inherits:
Struct
  • Object
show all
Defined in:
lib/cassandra_model/data_inquirer.rb

Instance Method Summary collapse

Instance Method Details

#default_to(value) ⇒ Object



63
64
65
# File 'lib/cassandra_model/data_inquirer.rb', line 63

def default_to(value)
  inquirer.column_defaults[column] = value
end

#to(value) ⇒ Object



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/cassandra_model/data_inquirer.rb', line 46

def to(value)
  default_to(value)

  case value
    when Integer then
      retype_to(:int)
    when Float then
      retype_to(:double)
    when Time then
      retype_to(:timestamp)
    when Cassandra::Uuid then
      retype_to(:uuid)
    when String then
      retype_to(:text)
  end
end