Class: Elasticsearch::Transport::Transport::Serializer::MultiJson

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/elasticsearch/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


29
30
31
# File 'lib/elasticsearch/transport/transport/serializer/multi_json.rb', line 29

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

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

De-serialize a Hash from JSON string


23
24
25
# File 'lib/elasticsearch/transport/transport/serializer/multi_json.rb', line 23

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