Class: DbSchema::Definitions::Field::Array
- Defined in:
- lib/db_schema/definitions/field/array.rb
Instance Attribute Summary collapse
-
#element_type ⇒ Object
readonly
Returns the value of attribute element_type.
Attributes inherited from Base
Instance Method Summary collapse
- #attributes ⇒ Object
-
#initialize(name, of:, **options) ⇒ Array
constructor
A new instance of Array.
Methods inherited from Base
attributes, #custom_type?, default_attribute_values, #null?, #options, #primary_key?, #process_default, register, #type, type, valid_attributes
Constructor Details
#initialize(name, of:, **options) ⇒ Array
Returns a new instance of Array.
8 9 10 11 |
# File 'lib/db_schema/definitions/field/array.rb', line 8 def initialize(name, of:, **) super(name, **) @element_type = Field.type_class_for(of) end |
Instance Attribute Details
#element_type ⇒ Object (readonly)
Returns the value of attribute element_type.
6 7 8 |
# File 'lib/db_schema/definitions/field/array.rb', line 6 def element_type @element_type end |
Instance Method Details
#attributes ⇒ Object
13 14 15 |
# File 'lib/db_schema/definitions/field/array.rb', line 13 def attributes super.merge(element_type: element_type.type) end |