Class: DisposableDB::TableTemplate::Column

Inherits:
Object
  • Object
show all
Defined in:
lib/disposable_db/table_template.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, type, options = {}) ⇒ Column

Returns a new instance of Column.



34
35
36
37
38
# File 'lib/disposable_db/table_template.rb', line 34

def initialize(name, type, options = {})
  @name = name
  @type = type
  @indexed = options[:indexed] || false
end

Instance Attribute Details

#indexedObject

Returns the value of attribute indexed.



24
25
26
# File 'lib/disposable_db/table_template.rb', line 24

def indexed
  @indexed
end

#nameObject

Returns the value of attribute name.



24
25
26
# File 'lib/disposable_db/table_template.rb', line 24

def name
  @name
end

#typeObject

Returns the value of attribute type.



24
25
26
# File 'lib/disposable_db/table_template.rb', line 24

def type
  @type
end

Class Method Details

.typesObject



26
27
28
29
30
31
32
# File 'lib/disposable_db/table_template.rb', line 26

def self.types
  # [String, Integer, Fixnum, Bignum, Float, Numeric, BigDecimal, Date, DateTime, Time, File, TrueClass, FalseClass]
  #types = Sequel::Schema::Generator::GENERIC_TYPES

  #name ? types.select { |t| t.name == name }.first : types
  Sequel::Schema::Generator::GENERIC_TYPES
end