Class: Tidepool::JSONParser

Inherits:
HTTParty::Parser
  • Object
show all
Defined in:
lib/tidepool/json_parser.rb

Instance Method Summary collapse

Constructor Details

#initialize(body, format) ⇒ JSONParser

override parser initalizer to check for bad empty array before parsing this is a known bug in the Tidepool API



5
6
7
8
# File 'lib/tidepool/json_parser.rb', line 5

def initialize(body, format)
  @body = (body == "]") ? "[]" : body
  @format = format
end