Class: T::Array

Inherits:
Object
  • Object
show all
Defined in:
lib/json_model/types/array.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, **options) ⇒ Array

Returns a new instance of Array.

Parameters:

  • type (Class)
  • options (Hash)


7
8
9
10
# File 'lib/json_model/types/array.rb', line 7

def initialize(type, **options)
  @type = type
  @options = options
end

Class Method Details

.[](type, **options) ⇒ Array

Parameters:

  • type (Class)
  • options (Hash)

Returns:



24
25
26
# File 'lib/json_model/types/array.rb', line 24

def [](type, **options)
  Array.new(type, **options)
end

Instance Method Details

#to_type_specJsonModel::TypeSpec::Array



13
14
15
16
17
18
# File 'lib/json_model/types/array.rb', line 13

def to_type_spec
  JsonModel::TypeSpec::Array.new(
    JsonModel::TypeSpec.resolve(@type),
    **@options,
  )
end