Class: Congress::Client
- Inherits:
-
Object
- Object
- Congress::Client
- Includes:
- Connection, Request
- Defined in:
- lib/congress/client.rb
Constant Summary
Constants included from Connection
Congress::Connection::ENDPOINT
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
Instance Method Summary collapse
-
#bills(options = {}) ⇒ Hashie::Rash
Legislation in the House and Senate, back to 2009.
-
#bills_search(options = {}) ⇒ Hashie::Rash
Full text search over legislation.
-
#committees(options = {}) ⇒ Hashie::Rash
Current committees, subcommittees, and their membership.
-
#districts_locate(*args) ⇒ Hashie::Rash
Find congressional districts for a latitude/longitude, zip, or address.
-
#floor_updates(options = {}) ⇒ Hashie::Rash
To-the-minute updates from the floor of the House and Senate.
-
#hearings(options = {}) ⇒ Hashie::Rash
Committee hearings in Congress.
-
#initialize(key) ⇒ Client
constructor
A new instance of Client.
-
#legislators(options = {}) ⇒ Hashie::Rash
Current legislators' names, IDs, biography, and social media.
-
#legislators_locate(*args) ⇒ Hashie::Rash
Find representatives and senators for a latitude/longitude, zip, or address.
-
#upcoming_bills(options = {}) ⇒ Hashie::Rash
Bills scheduled for debate in the future, as announced by party leadership.
-
#votes(options = {}) ⇒ Hashie::Rash
Roll call votes in Congress, back to 2009.
Methods included from Request
Constructor Details
#initialize(key) ⇒ Client
11 12 13 |
# File 'lib/congress/client.rb', line 11 def initialize(key) @key = key end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
9 10 11 |
# File 'lib/congress/client.rb', line 9 def key @key end |
Instance Method Details
#bills(options = {}) ⇒ Hashie::Rash
Legislation in the House and Senate, back to 2009. Updated daily.
65 66 67 |
# File 'lib/congress/client.rb', line 65 def bills( = {}) get('/bills', ) end |
#bills_search(options = {}) ⇒ Hashie::Rash
Full text search over legislation.
75 76 77 |
# File 'lib/congress/client.rb', line 75 def bills_search( = {}) get('/bills/search', ) end |
#committees(options = {}) ⇒ Hashie::Rash
Current committees, subcommittees, and their membership.
55 56 57 |
# File 'lib/congress/client.rb', line 55 def committees( = {}) get('/committees', ) end |
#districts_locate(*args) ⇒ Hashie::Rash
Find congressional districts for a latitude/longitude, zip, or address.
45 46 47 |
# File 'lib/congress/client.rb', line 45 def districts_locate(*args) get('/districts/locate', extract_location(args)) end |
#floor_updates(options = {}) ⇒ Hashie::Rash
To-the-minute updates from the floor of the House and Senate.
95 96 97 |
# File 'lib/congress/client.rb', line 95 def floor_updates( = {}) get('/floor_updates', ) end |
#hearings(options = {}) ⇒ Hashie::Rash
Committee hearings in Congress. Updated as hearings are announced.
105 106 107 |
# File 'lib/congress/client.rb', line 105 def hearings( = {}) get('/hearings', ) end |
#legislators(options = {}) ⇒ Hashie::Rash
Current legislators' names, IDs, biography, and social media.
21 22 23 |
# File 'lib/congress/client.rb', line 21 def legislators( = {}) get('/legislators', ) end |
#legislators_locate(*args) ⇒ Hashie::Rash
Find representatives and senators for a latitude/longitude, zip, or address.
33 34 35 |
# File 'lib/congress/client.rb', line 33 def legislators_locate(*args) get('/legislators/locate', extract_location(args)) end |
#upcoming_bills(options = {}) ⇒ Hashie::Rash
Bills scheduled for debate in the future, as announced by party leadership.
115 116 117 |
# File 'lib/congress/client.rb', line 115 def upcoming_bills( = {}) get('/upcoming_bills', ) end |
#votes(options = {}) ⇒ Hashie::Rash
Roll call votes in Congress, back to 2009. Updated within minutes of votes.
85 86 87 |
# File 'lib/congress/client.rb', line 85 def votes( = {}) get('/votes', ) end |