Class: GovSdk
- Inherits:
-
Object
- Object
- GovSdk
- Defined in:
- lib/govsdk.rb
Overview
require “ruby-debug” Debugger.settings = 1 # list nearby lines on stop Debugger.settings = 1 Debugger.start
Class Method Summary collapse
- .google_api ⇒ Object
- .init(apikeys = {}) ⇒ Object
- .load_apis ⇒ Object
- .opensecrets_api ⇒ Object
- .sunlight_api ⇒ Object
- .votesmart_api ⇒ Object
Class Method Details
.google_api ⇒ Object
51 52 53 |
# File 'lib/govsdk.rb', line 51 def self.google_api @google_api end |
.init(apikeys = {}) ⇒ Object
55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/govsdk.rb', line 55 def self.init(apikeys = {}) apikeys.keys.each { |x| raise ArgumentError unless [:google, :followmoney, :sunlight, :opensecrets, :votesmart].include?(x) } GovSdk.load_apis apikeys.each do |key, val| @sunlight_api.key = val if key == :sunlight @opensecrets_api.key = val if key == :opensecrets @followm_api.key = val if key == :followmoney @votesmart_api.key = val if key == :votesmart @google_api.key = val if key == :google end end |
.load_apis ⇒ Object
32 33 34 35 36 37 |
# File 'lib/govsdk.rb', line 32 def self.load_apis @sunlight_api = SunlightApi.new @opensecrets_api = OpenSecretsApi.new @votesmart_api = VoteSmartApi.new @google_api = GoogleApi.new end |
.opensecrets_api ⇒ Object
47 48 49 |
# File 'lib/govsdk.rb', line 47 def self.opensecrets_api @opensecrets_api end |
.sunlight_api ⇒ Object
43 44 45 |
# File 'lib/govsdk.rb', line 43 def self.sunlight_api @sunlight_api end |
.votesmart_api ⇒ Object
39 40 41 |
# File 'lib/govsdk.rb', line 39 def self.votesmart_api @votesmart_api end |