Class: ASIR::Coder::JSON

Inherits:
ASIR::Coder show all
Defined in:
lib/asir/coder/json.rb

Overview

!SLIDE JSON Coder

Note: Symbols are not handled. The actual JSON expression is wrapped with an Array.

Instance Method Summary collapse

Instance Method Details

#_decode(obj) ⇒ Object



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

def _decode obj
  ::JSON.parser.new(obj).
    parse.first
end

#_encode(obj) ⇒ Object



11
12
13
# File 'lib/asir/coder/json.rb', line 11

def _encode obj
  [ obj ].to_json
end