Class: Liquigen::ModifyDataType
- Defined in:
- lib/liquigen/modify_data_type.rb
Instance Attribute Summary collapse
-
#column_name ⇒ Object
Returns the value of attribute column_name.
-
#new_date_type ⇒ Object
Returns the value of attribute new_date_type.
-
#table_name ⇒ Object
Returns the value of attribute table_name.
Instance Method Summary collapse
-
#initialize(table, from, to) ⇒ ModifyDataType
constructor
A new instance of ModifyDataType.
Constructor Details
#initialize(table, from, to) ⇒ ModifyDataType
Returns a new instance of ModifyDataType.
9 10 11 12 13 |
# File 'lib/liquigen/modify_data_type.rb', line 9 def initialize(table, from, to) self.table_name = table&.underscore&.pluralize self.column_name = from self.new_date_type = TypeMap.new(to).db_type || to end |
Instance Attribute Details
#column_name ⇒ Object
Returns the value of attribute column_name.
6 7 8 |
# File 'lib/liquigen/modify_data_type.rb', line 6 def column_name @column_name end |
#new_date_type ⇒ Object
Returns the value of attribute new_date_type.
7 8 9 |
# File 'lib/liquigen/modify_data_type.rb', line 7 def new_date_type @new_date_type end |
#table_name ⇒ Object
Returns the value of attribute table_name.
5 6 7 |
# File 'lib/liquigen/modify_data_type.rb', line 5 def table_name @table_name end |