Module: JSONAPI::Rails::ActionController::ClassMethods
- Defined in:
- lib/jsonapi/rails/action_controller.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.
25 26 27 28 29 |
# File 'lib/jsonapi/rails/action_controller.rb', line 25 def _deserializable(key, , fallback, &block) = .dup klass = .delete(:class) || Class.new(fallback, &block) use Deserialization, key, klass, end |
#deserializable_relationship(key, options = {}, &block) ⇒ Object
19 20 21 22 |
# File 'lib/jsonapi/rails/action_controller.rb', line 19 def deserializable_relationship(key, = {}, &block) _deserializable(key, , JSONAPI::Deserializable::Relationship, &block) end |
#deserializable_resource(key, options = {}, &block) ⇒ Object
14 15 16 17 |
# File 'lib/jsonapi/rails/action_controller.rb', line 14 def deserializable_resource(key, = {}, &block) _deserializable(key, , JSONAPI::Deserializable::Resource, &block) end |