lib/ny-times/congress/base.rb in hoverbird-ny-times-congress-1.1.0 vs lib/ny-times/congress/base.rb in hoverbird-ny-times-congress-1.2.0
- old
+ new
@@ -1,12 +1,12 @@
module NYTimes
module Congress
class Base
- API_NAME = 'congress'
- API_SERVER = 'api.nytimes.com'
- API_VERSION = 2
- API_BASE = "/svc/politics/v#{API_VERSION}/us/legislative/#{API_NAME}"
+ API_NAME = 'congress'
+ API_SERVER = 'api.nytimes.com'
+ API_VERSION = 2
+ API_BASE = "/svc/politics/v#{API_VERSION}/us/legislative/#{API_NAME}"
@@api_key = nil
@@copyright = nil
class << self
@@ -38,11 +38,11 @@
raise "You must initialize the API key before you run any API queries"
end
full_params = params.merge 'api-key' => @@api_key
uri = build_request_url(path, full_params)
-
+
reply = uri.read
reply = JSON.parse(reply)
raise "Empty reply returned from API" if reply.nil?
@@ -62,9 +62,9 @@
attributes[:#{attribute}]
end
EVAL
end
end
+
end
-
end
end
\ No newline at end of file