Module: Sandal::Json
- Defined in:
- lib/sandal/json.rb
Overview
Contains JSON encode and decode functionality.
Class Method Summary collapse
-
.dump(raw) ⇒ String
Encodes a Ruby object as JSON.
-
.load(encoded) ⇒ Object
Decode a JSON string into Ruby.
Class Method Details
.dump(raw) ⇒ String
Encodes a Ruby object as JSON. This version delegates to MultiJson.
19 20 21 |
# File 'lib/sandal/json.rb', line 19 def self.dump(raw) JSON.generate(raw) end |
.load(encoded) ⇒ Object
Decode a JSON string into Ruby. This version delegates to MultiJson.
11 12 13 |
# File 'lib/sandal/json.rb', line 11 def self.load(encoded) JSON.parse(encoded) end |