Module: Spring::JSON

Defined in:
lib/spring/json.rb

Class Method Summary collapse

Class Method Details

.dump(data) ⇒ Object


20
21
22
# File 'lib/spring/json.rb', line 20

def self.dump(data)
  OkJson.encode(data)
end

.load(string) ⇒ Object


15
16
17
18
# File 'lib/spring/json.rb', line 15

def self.load(string)
  string.force_encoding("utf-8")
  OkJson.decode(string)
end