Class: XToJson::Engines::Yajl

Inherits:
Object
  • Object
show all
Defined in:
lib/x_to_json/engines/yajl.rb

Class Method Summary collapse

Class Method Details

.decode(string, options = {}) ⇒ Object



6
7
8
# File 'lib/x_to_json/engines/yajl.rb', line 6

def self.decode(string, options = {})
  ::Yajl::Parser.new(:symbolize_keys => options[:symbolize_keys]).parse(string)
end

.encode(object) ⇒ Object



10
11
12
# File 'lib/x_to_json/engines/yajl.rb', line 10

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