Class: Odin::Types::SchemaArray
- Inherits:
-
Object
- Object
- Odin::Types::SchemaArray
- Defined in:
- lib/odin/types/schema.rb
Overview
Schema array definition
Instance Attribute Summary collapse
-
#columns ⇒ Object
readonly
Returns the value of attribute columns.
-
#item_fields ⇒ Object
readonly
Returns the value of attribute item_fields.
-
#item_type_ref ⇒ Object
readonly
Returns the value of attribute item_type_ref.
-
#max_items ⇒ Object
readonly
Returns the value of attribute max_items.
-
#min_items ⇒ Object
readonly
Returns the value of attribute min_items.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#unique ⇒ Object
readonly
Returns the value of attribute unique.
Instance Method Summary collapse
-
#initialize(path:, item_fields: {}, min_items: nil, max_items: nil, unique: false, columns: nil, item_type_ref: nil) ⇒ SchemaArray
constructor
A new instance of SchemaArray.
Constructor Details
#initialize(path:, item_fields: {}, min_items: nil, max_items: nil, unique: false, columns: nil, item_type_ref: nil) ⇒ SchemaArray
Returns a new instance of SchemaArray.
182 183 184 185 186 187 188 189 190 191 192 193 |
# File 'lib/odin/types/schema.rb', line 182 def initialize(path:, item_fields: {}, min_items: nil, max_items: nil, unique: false, columns: nil, item_type_ref: nil) @path = path.freeze @item_fields = item_fields.freeze @min_items = min_items @max_items = max_items @unique = unique @columns = columns&.freeze # For an `arr[] = @type` declaration, the entry fields come from this type. @item_type_ref = item_type_ref&.freeze freeze end |
Instance Attribute Details
#columns ⇒ Object (readonly)
Returns the value of attribute columns.
179 180 181 |
# File 'lib/odin/types/schema.rb', line 179 def columns @columns end |
#item_fields ⇒ Object (readonly)
Returns the value of attribute item_fields.
179 180 181 |
# File 'lib/odin/types/schema.rb', line 179 def item_fields @item_fields end |
#item_type_ref ⇒ Object (readonly)
Returns the value of attribute item_type_ref.
179 180 181 |
# File 'lib/odin/types/schema.rb', line 179 def item_type_ref @item_type_ref end |
#max_items ⇒ Object (readonly)
Returns the value of attribute max_items.
179 180 181 |
# File 'lib/odin/types/schema.rb', line 179 def max_items @max_items end |
#min_items ⇒ Object (readonly)
Returns the value of attribute min_items.
179 180 181 |
# File 'lib/odin/types/schema.rb', line 179 def min_items @min_items end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
179 180 181 |
# File 'lib/odin/types/schema.rb', line 179 def path @path end |
#unique ⇒ Object (readonly)
Returns the value of attribute unique.
179 180 181 |
# File 'lib/odin/types/schema.rb', line 179 def unique @unique end |