Class: Nandi::Instructions::CreateTable
- Inherits:
-
Object
- Object
- Nandi::Instructions::CreateTable
- Defined in:
- lib/nandi/instructions/create_table.rb
Defined Under Namespace
Classes: ColumnsReader
Instance Attribute Summary collapse
-
#columns ⇒ Object
readonly
Returns the value of attribute columns.
-
#extra_args ⇒ Object
readonly
Returns the value of attribute extra_args.
-
#table ⇒ Object
readonly
Returns the value of attribute table.
-
#timestamps_args ⇒ Object
readonly
Returns the value of attribute timestamps_args.
Instance Method Summary collapse
-
#initialize(table:, columns_block:, **kwargs) ⇒ CreateTable
constructor
A new instance of CreateTable.
- #lock ⇒ Object
- #procedure ⇒ Object
Constructor Details
#initialize(table:, columns_block:, **kwargs) ⇒ CreateTable
Returns a new instance of CreateTable.
10 11 12 13 14 15 16 17 |
# File 'lib/nandi/instructions/create_table.rb', line 10 def initialize(table:, columns_block:, **kwargs) @table = table columns_reader = ColumnsReader.new columns_block.call(columns_reader) @columns = columns_reader.columns @extra_args = kwargs unless kwargs.empty? @timestamps_args = columns_reader. end |
Instance Attribute Details
#columns ⇒ Object (readonly)
Returns the value of attribute columns.
8 9 10 |
# File 'lib/nandi/instructions/create_table.rb', line 8 def columns @columns end |
#extra_args ⇒ Object (readonly)
Returns the value of attribute extra_args.
8 9 10 |
# File 'lib/nandi/instructions/create_table.rb', line 8 def extra_args @extra_args end |
#table ⇒ Object (readonly)
Returns the value of attribute table.
8 9 10 |
# File 'lib/nandi/instructions/create_table.rb', line 8 def table @table end |
#timestamps_args ⇒ Object (readonly)
Returns the value of attribute timestamps_args.
8 9 10 |
# File 'lib/nandi/instructions/create_table.rb', line 8 def @timestamps_args end |
Instance Method Details
#lock ⇒ Object
23 24 25 |
# File 'lib/nandi/instructions/create_table.rb', line 23 def lock Nandi::Migration::LockWeights::ACCESS_EXCLUSIVE end |
#procedure ⇒ Object
19 20 21 |
# File 'lib/nandi/instructions/create_table.rb', line 19 def procedure :create_table end |