Class: ElasticSearch::Encoding::JSON

Inherits:
Base
  • Object
show all
Defined in:
lib/elasticsearch/encoding/json.rb

Instance Method Summary collapse

Instance Method Details

#decode(string) ⇒ Object



10
11
12
# File 'lib/elasticsearch/encoding/json.rb', line 10

def decode(string)
  Yajl::Parser.parse(string)
end

#encode(object) ⇒ Object



6
7
8
# File 'lib/elasticsearch/encoding/json.rb', line 6

def encode(object)
  Yajl::Encoder.encode(object)
end

#is_encoded?(object) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/elasticsearch/encoding/json.rb', line 14

def is_encoded?(object)
  object.is_a?(String)
end