Module: Leadlight::BasicConverter
- Defined in:
- lib/leadlight/basic_converter.rb
Instance Method Summary collapse
- #decode_with_type(content_type, entity_body, options = {}) ⇒ Object
- #encode_with_type(content_type, object, options = {}) ⇒ Object
- #initialize(codec) ⇒ Object
Instance Method Details
#decode_with_type(content_type, entity_body, options = {}) ⇒ Object
9 10 11 |
# File 'lib/leadlight/basic_converter.rb', line 9 def decode_with_type(content_type, entity_body, ={}) codec.decode(content_type, entity_body, ) end |
#encode_with_type(content_type, object, options = {}) ⇒ Object
13 14 15 16 |
# File 'lib/leadlight/basic_converter.rb', line 13 def encode_with_type(content_type, object, ={}) body = codec.encode(content_type, object, ) Entity.new(content_type, body) end |
#initialize(codec) ⇒ Object
5 6 7 |
# File 'lib/leadlight/basic_converter.rb', line 5 def initialize(codec) @codec = codec end |