Class: JsonModel::TypeSpec::Object
- Inherits:
-
JsonModel::TypeSpec
- Object
- JsonModel::TypeSpec
- JsonModel::TypeSpec::Object
- Defined in:
- lib/json_model/type_spec/object.rb
Instance Method Summary collapse
- #as_schema(**options) ⇒ Hash
- #cast(json) ⇒ ::Object
-
#initialize(type) ⇒ Object
constructor
A new instance of Object.
- #referenced_schemas ⇒ Array<TypeSpec>
Methods inherited from JsonModel::TypeSpec
#register_validations, resolve
Constructor Details
#initialize(type) ⇒ Object
Returns a new instance of Object.
7 8 9 10 |
# File 'lib/json_model/type_spec/object.rb', line 7 def initialize(type) super() @type = type end |
Instance Method Details
#as_schema(**options) ⇒ Hash
14 15 16 |
# File 'lib/json_model/type_spec/object.rb', line 14 def as_schema(**) @type.as_schema(**) end |
#cast(json) ⇒ ::Object
25 26 27 |
# File 'lib/json_model/type_spec/object.rb', line 25 def cast(json) @type.new(**json) end |