Class: CongressApi::Bills
Instance Method Summary collapse
- #by_id(congress, id) ⇒ Object
- #cosponsors(congress, id) ⇒ Object
-
#recent(congress, chamber, type) ⇒ Object
introduced, updated, passed or major.
-
#recent_by_member(id, type) ⇒ Object
introduced or updated.
-
#related(congress, id, type) ⇒ Object
subjects, amendments or related.
Methods inherited from V1
Constructor Details
This class inherits a constructor from CongressApi::V1
Instance Method Details
#by_id(congress, id) ⇒ Object
11 12 13 |
# File 'lib/congress_api/bills.rb', line 11 def by_id(congress, id) v1.get("/#{congress}/bills/#{id}.json").parsed_response.results.first end |
#cosponsors(congress, id) ⇒ Object
19 20 21 |
# File 'lib/congress_api/bills.rb', line 19 def cosponsors(congress, id) v1.get("/#{congress}/bills/#{id}/cosponsors.json").parsed_response.results.first end |
#recent(congress, chamber, type) ⇒ Object
introduced, updated, passed or major
3 4 5 |
# File 'lib/congress_api/bills.rb', line 3 def recent(congress, chamber, type) # introduced, updated, passed or major v1.get("/#{congress}/#{chamber}/bills/#{type}.json").parsed_response.results.first end |
#recent_by_member(id, type) ⇒ Object
introduced or updated
7 8 9 |
# File 'lib/congress_api/bills.rb', line 7 def recent_by_member(id, type) # introduced or updated v1.get("/members/#{id}/bills/#{type}.json").parsed_response.results.first end |
#related(congress, id, type) ⇒ Object
subjects, amendments or related
15 16 17 |
# File 'lib/congress_api/bills.rb', line 15 def (congress, id, type) # subjects, amendments or related v1.get("/#{congress}/bills/#{id}/#{type}.json").parsed_response.results.first end |