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 virtual bigserial bit 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
62 63 64 65 |
# File 'lib/nandi/instructions/create_table.rb', line 62 def initialize @columns = [] = 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 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 << OpenStruct.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) = args end |