Class: Elastic::Transport::Transport::Serializer::MultiJson

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/elastic/transport/transport/serializer/multi_json.rb

Overview

A default JSON serializer (using [MultiJSON](rubygems.org/gems/multi_json))

Instance Method Summary collapse

Methods included from Base

#initialize

Instance Method Details

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

Serialize a Hash to JSON string



45
46
47
# File 'lib/elastic/transport/transport/serializer/multi_json.rb', line 45

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

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

De-serialize a Hash from JSON string



39
40
41
# File 'lib/elastic/transport/transport/serializer/multi_json.rb', line 39

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