Module: Doze::Serialization
- Defined in:
- lib/doze/serialization/yaml.rb,
lib/doze/serialization/html.rb,
lib/doze/serialization/json.rb,
lib/doze/serialization/entity.rb,
lib/doze/serialization/resource.rb,
lib/doze/serialization/www_form_encoded.rb,
lib/doze/serialization/multipart_form_data.rb
Overview
A resource whose representations are all serializations of some ruby data. A good example of how to do media type negotiation
Defined Under Namespace
Modules: FormDataHelpers, Resource Classes: Entity, ResourceProxy
Constant Summary collapse
- HTML =
A browser-friendly media type for use with Doze::Serialization::Resource. We don’t register it, since you might not want to use it for submitted html entities, but you can call register! on it yourself if you do
Doze::MediaType.new('text/html', :entity_class => Entity::HTML, :extension => 'html')
- JSON =
Doze::MediaType.register('application/json', :plus_suffix => 'json', :entity_class => Entity::JSON, :extension => 'json')
- YAML =
Doze::MediaType.register('application/yaml', :plus_suffix => 'yaml', :entity_class => Entity::YAML, :extension => 'yaml')
- WWW_FORM_ENCODED =
A browser-friendly media type for use with Doze::Serialization::Resource.
Doze::MediaType.register('application/x-www-form-urlencoded', :entity_class => Entity::WWWFormEncoded)
- MULTIPART_FORM_DATA =
A browser-friendly media type for use with Doze::Serialization::Resource.
Doze::MediaType.register('multipart/form-data', :entity_class => Entity::MultipartFormData)