Class: Odin::Types::SchemaArray

Inherits:
Object
  • Object
show all
Defined in:
lib/odin/types/schema.rb

Overview

Schema array definition

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#columnsObject (readonly)

Returns the value of attribute columns.



179
180
181
# File 'lib/odin/types/schema.rb', line 179

def columns
  @columns
end

#item_fieldsObject (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_refObject (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_itemsObject (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_itemsObject (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

#pathObject (readonly)

Returns the value of attribute path.



179
180
181
# File 'lib/odin/types/schema.rb', line 179

def path
  @path
end

#uniqueObject (readonly)

Returns the value of attribute unique.



179
180
181
# File 'lib/odin/types/schema.rb', line 179

def unique
  @unique
end