Class: Fluent::Plugin::Serializer::Oj

Inherits:
Object
  • Object
show all
Includes:
TRANSPORT_CLASS::Transport::Serializer::Base
Defined in:
lib/fluent/plugin/oj_serializer.rb

Instance Method Summary collapse

Instance Method Details

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

Serialize a Hash to JSON string



18
19
20
# File 'lib/fluent/plugin/oj_serializer.rb', line 18

def dump(object, options={})
  ::Oj.dump(object, options)
end

#load(string, options = {}) ⇒ Object

De-serialize a Hash from JSON string



12
13
14
# File 'lib/fluent/plugin/oj_serializer.rb', line 12

def load(string, options={})
  ::Oj.load(string, options)
end