Module: Leadlight::BasicConverter

Defined in:
lib/leadlight/basic_converter.rb

Instance Method Summary collapse

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, options={})
  codec.decode(content_type, entity_body, options)
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, options={})
  body = codec.encode(content_type, object, options)
  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