Module: Doze::Serialization::Resource
- Included in:
- Collection::Object, Resource::Error, ResourceProxy
- Defined in:
- lib/doze/serialization/resource.rb
Instance Method Summary collapse
-
#accepts_method_with_media_type?(method, entity) ⇒ Boolean
You may want to be more particular than this if you can only deal with certain serialization types.
- #get ⇒ Object
-
#get_data ⇒ Object
Analogous to get, but returns data which may be serialized into entities of any one of serialization_media_types.
-
#serialization_media_types ⇒ Object
You probably want to override these.
Instance Method Details
#accepts_method_with_media_type?(method, entity) ⇒ Boolean
You may want to be more particular than this if you can only deal with certain serialization types
26 27 28 |
# File 'lib/doze/serialization/resource.rb', line 26 def accepts_method_with_media_type?(method, entity) entity.is_a?(Doze::Serialization::Entity) end |
#get ⇒ Object
19 20 21 22 23 |
# File 'lib/doze/serialization/resource.rb', line 19 def get serialization_media_types.map do |media_type| media_type.entity_class.new(media_type, :lazy_object_data => proc {get_data}) end end |
#get_data ⇒ Object
Analogous to get, but returns data which may be serialized into entities of any one of serialization_media_types
16 17 |
# File 'lib/doze/serialization/resource.rb', line 16 def get_data end |