Class: Nimbu::Response::Json

Inherits:
Nimbu::Response
  • Object
show all
Includes:
Utils::Json
Defined in:
lib/nimbu-api/response/json.rb

Constant Summary

Constants inherited from Nimbu::Response

CONTENT_TYPE

Instance Method Summary collapse

Methods included from Utils::Json

#decode

Methods inherited from Nimbu::Response

define_parser, #parse_response?, #response_type

Instance Method Details

#parse(body) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/nimbu-api/response/json.rb', line 16

def parse(body)
  case body
  when ''
    nil
  when 'true'
    true
  when 'false'
    false
  else
    self.class.parser.call body
  end
end