Class: Nandi::Instructions::CreateTable::ColumnsReader
- Inherits:
-
Object
- Object
- Nandi::Instructions::CreateTable::ColumnsReader
- Defined in:
- lib/nandi/instructions/create_table.rb
Constant Summary collapse
- TYPES =
%i[ bigint binary boolean date datetime decimal float integer json string text time timestamp virtual bigserial bit bit_varying box cidr circle citext daterange hstore inet int4range int8range interval jsonb line lseg ltree macaddr money numrange oid path point polygon primary_key serial tsrange tstzrange tsvector uuid xml ].freeze
Instance Attribute Summary collapse
-
#columns ⇒ Object
readonly
Returns the value of attribute columns.
-
#timestamps_args ⇒ Object
readonly
Returns the value of attribute timestamps_args.
Instance Method Summary collapse
- #column(name, type, **args) ⇒ Object
-
#initialize ⇒ ColumnsReader
constructor
A new instance of ColumnsReader.
- #timestamps(**args) ⇒ Object
Constructor Details
#initialize ⇒ ColumnsReader
Returns a new instance of ColumnsReader.
62 63 64 65 |
# File 'lib/nandi/instructions/create_table.rb', line 62 def initialize @columns = [] @timestamps_args = nil end |
Instance Attribute Details
#columns ⇒ Object (readonly)
Returns the value of attribute columns.
28 29 30 |
# File 'lib/nandi/instructions/create_table.rb', line 28 def columns @columns end |
#timestamps_args ⇒ Object (readonly)
Returns the value of attribute timestamps_args.
28 29 30 |
# File 'lib/nandi/instructions/create_table.rb', line 28 def @timestamps_args end |
Instance Method Details
#column(name, type, **args) ⇒ Object
67 68 69 |
# File 'lib/nandi/instructions/create_table.rb', line 67 def column(name, type, **args) @columns << Column.new(name: name, type: type, args: args) end |
#timestamps(**args) ⇒ Object
71 72 73 |
# File 'lib/nandi/instructions/create_table.rb', line 71 def (**args) @timestamps_args = args end |