Module: Riak::Serializers

Extended by:
Serializers
Includes:
Util::Translation
Included in:
Serializers
Defined in:
lib/riak/serializers.rb

Defined Under Namespace

Modules: ApplicationJSON, TextPlain

Instance Method Summary collapse

Methods included from Util::Translation

#i18n_scope, #t

Instance Method Details

#[](content_type) ⇒ Object



6
7
8
# File 'lib/riak/serializers.rb', line 6

def [](content_type)
  serializers[content_type]
end

#[]=(content_type, serializer) ⇒ Object



10
11
12
# File 'lib/riak/serializers.rb', line 10

def []=(content_type, serializer)
  serializers[content_type] = serializer
end

#deserialize(content_type, content) ⇒ Object



18
19
20
# File 'lib/riak/serializers.rb', line 18

def deserialize(content_type, content)
  serializer_for(content_type).load(content)
end

#serialize(content_type, content) ⇒ Object



14
15
16
# File 'lib/riak/serializers.rb', line 14

def serialize(content_type, content)
  serializer_for(content_type).dump(content)
end