Class: RocketPants::Respondable::SerializerWrapper
- Inherits:
-
Struct
- Object
- Struct
- RocketPants::Respondable::SerializerWrapper
- Defined in:
- lib/rocket_pants/controller/respondable.rb
Instance Attribute Summary collapse
-
#object ⇒ Object
Returns the value of attribute object.
-
#serializer ⇒ Object
Returns the value of attribute serializer.
Instance Method Summary collapse
Instance Attribute Details
#object ⇒ Object
Returns the value of attribute object
5 6 7 |
# File 'lib/rocket_pants/controller/respondable.rb', line 5 def object @object end |
#serializer ⇒ Object
Returns the value of attribute serializer
5 6 7 |
# File 'lib/rocket_pants/controller/respondable.rb', line 5 def serializer @serializer end |
Instance Method Details
#serializable_hash(options = {}) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/rocket_pants/controller/respondable.rb', line 7 def serializable_hash( = {}) instance = serializer.new(object, ) if instance.respond_to?(:serializable_hash) instance.serializable_hash else instance.as_json end end |