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.



161
162
163
164
165
166
167
168
169
170
# File 'lib/odin/types/schema.rb', line 161

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.



159
160
161
# File 'lib/odin/types/schema.rb', line 159

def columns
  @columns
end

#item_fieldsObject (readonly)

Returns the value of attribute item_fields.



159
160
161
# File 'lib/odin/types/schema.rb', line 159

def item_fields
  @item_fields
end

#max_itemsObject (readonly)

Returns the value of attribute max_items.



159
160
161
# File 'lib/odin/types/schema.rb', line 159

def max_items
  @max_items
end

#min_itemsObject (readonly)

Returns the value of attribute min_items.



159
160
161
# File 'lib/odin/types/schema.rb', line 159

def min_items
  @min_items
end

#pathObject (readonly)

Returns the value of attribute path.



159
160
161
# File 'lib/odin/types/schema.rb', line 159

def path
  @path
end

#uniqueObject (readonly)

Returns the value of attribute unique.



159
160
161
# File 'lib/odin/types/schema.rb', line 159

def unique
  @unique
end