Module: JSONAPI::Hanami::Deserialization::ClassMethods
- Defined in:
- lib/jsonapi/hanami/deserialization.rb
Instance Method Summary collapse
- #_deserializable(key, options, fallback, &block) ⇒ Object private
- #deserializable_relationship(key, options = {}, &block) ⇒ Object
- #deserializable_resource(key, options = {}, &block) ⇒ Object
Instance Method Details
#_deserializable(key, options, fallback, &block) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
22 23 24 25 |
# File 'lib/jsonapi/hanami/deserialization.rb', line 22 def _deserializable(key, , fallback, &block) klass = [:class] || Class.new(fallback, &block) use DeserializationMiddleware, key, klass end |
#deserializable_relationship(key, options = {}, &block) ⇒ Object
16 17 18 19 |
# File 'lib/jsonapi/hanami/deserialization.rb', line 16 def deserializable_relationship(key, = {}, &block) _deserializable(key, , JSONAPI::Deserializable::Relationship, &block) end |
#deserializable_resource(key, options = {}, &block) ⇒ Object
11 12 13 14 |
# File 'lib/jsonapi/hanami/deserialization.rb', line 11 def deserializable_resource(key, = {}, &block) _deserializable(key, , JSONAPI::Deserializable::Resource, &block) end |