Class: JSONPParser

Inherits:
HTTParty::Parser
  • Object
show all
Defined in:
lib/campminder/parser.rb

Constant Summary collapse

SupportedFormats =
{
  "application/javascript" => :jsonp,
  "application/json" => :json
}

Instance Method Summary collapse

Instance Method Details

#jsonObject



13
14
15
# File 'lib/campminder/parser.rb', line 13

def json
  JSON.load(body)
end

#jsonpObject



9
10
11
# File 'lib/campminder/parser.rb', line 9

def jsonp
  JSON.load(body.strip[2..-2], nil)
end