Class: DisposableDB::TableTemplate::Column
- Inherits:
-
Object
- Object
- DisposableDB::TableTemplate::Column
- Defined in:
- lib/disposable_db/table_template.rb
Instance Attribute Summary collapse
-
#indexed ⇒ Object
Returns the value of attribute indexed.
-
#name ⇒ Object
Returns the value of attribute name.
-
#type ⇒ Object
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, type, options = {}) ⇒ Column
constructor
A new instance of Column.
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, = {}) @name = name @type = type @indexed = [:indexed] || false end |
Instance Attribute Details
#indexed ⇒ Object
Returns the value of attribute indexed.
24 25 26 |
# File 'lib/disposable_db/table_template.rb', line 24 def indexed @indexed end |
#name ⇒ Object
Returns the value of attribute name.
24 25 26 |
# File 'lib/disposable_db/table_template.rb', line 24 def name @name end |
#type ⇒ Object
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
.types ⇒ Object
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 |