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) ⇒ SchemaArray

Returns a new instance of SchemaArray.



178
179
180
181
182
183
184
185
186
187
# File 'lib/odin/types/schema.rb', line 178

def initialize(path:, item_fields: {}, min_items: nil, max_items: nil,
               unique: false, columns: nil)
  @path = path.freeze
  @item_fields = item_fields.freeze
  @min_items = min_items
  @max_items = max_items
  @unique = unique
  @columns = columns&.freeze
  freeze
end

Instance Attribute Details

#columnsObject (readonly)

Returns the value of attribute columns.



176
177
178
# File 'lib/odin/types/schema.rb', line 176

def columns
  @columns
end

#item_fieldsObject (readonly)

Returns the value of attribute item_fields.



176
177
178
# File 'lib/odin/types/schema.rb', line 176

def item_fields
  @item_fields
end

#max_itemsObject (readonly)

Returns the value of attribute max_items.



176
177
178
# File 'lib/odin/types/schema.rb', line 176

def max_items
  @max_items
end

#min_itemsObject (readonly)

Returns the value of attribute min_items.



176
177
178
# File 'lib/odin/types/schema.rb', line 176

def min_items
  @min_items
end

#pathObject (readonly)

Returns the value of attribute path.



176
177
178
# File 'lib/odin/types/schema.rb', line 176

def path
  @path
end

#uniqueObject (readonly)

Returns the value of attribute unique.



176
177
178
# File 'lib/odin/types/schema.rb', line 176

def unique
  @unique
end