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



46
47
48
# File 'lib/elasticsearch/transport/transport/serializer/multi_json.rb', line 46

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

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

De-serialize a Hash from JSON string



40
41
42
# File 'lib/elasticsearch/transport/transport/serializer/multi_json.rb', line 40

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