Module: SportsDataApi::Request
Instance Method Summary collapse
- #response_json(path) ⇒ Object
- #response_xml(path) ⇒ Object
- #response_xml_xpath(path, xpath) ⇒ Object
Instance Method Details
#response_json(path) ⇒ Object
3 4 5 6 |
# File 'lib/sports_data_api/request.rb', line 3 def response_json(path) response = make_request(path) MultiJson.load(response.to_s) end |
#response_xml(path) ⇒ Object
8 9 10 11 |
# File 'lib/sports_data_api/request.rb', line 8 def response_xml(path) response = make_request(path) Nokogiri::XML(response.to_s).remove_namespaces! end |
#response_xml_xpath(path, xpath) ⇒ Object
13 14 15 |
# File 'lib/sports_data_api/request.rb', line 13 def response_xml_xpath(path, xpath) response_xml(path).xpath(xpath) end |