Class: XToJson::Engines::JsonPure

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

Class Method Summary collapse

Class Method Details

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



6
7
8
9
10
# File 'lib/x_to_json/engines/json_pure.rb', line 6

def self.decode(string, options = {})
  opts = {}
  opts[:symbolize_names] = options[:symbolize_keys]
  ::JSON.parse(string, opts)
end

.encode(object) ⇒ Object



12
13
14
# File 'lib/x_to_json/engines/json_pure.rb', line 12

def self.encode(object)
  object.to_json
end