Method: Leadlight::TypeMap::DefaultType#encode

Defined in:
lib/leadlight/type_map.rb

#encode(object, options = {}) ⇒ Object



84
85
86
87
88
89
# File 'lib/leadlight/type_map.rb', line 84

def encode(object, options={})
  return Entity.new(nil, nil) if object.nil?
  content_type = options.delete(:content_type){"application/json"}
  body = @codec.encode(content_type, object, options)
  Entity.new(content_type, body)
end