Class: CongressApi::Bills

Inherits:
V1
  • Object
show all
Defined in:
lib/congress_api/bills.rb

Instance Method Summary collapse

Methods inherited from V1

#initialize, #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

subjects, amendments or related



15
16
17
# File 'lib/congress_api/bills.rb', line 15

def related(congress, id, type) # subjects, amendments or related
  v1.get("/#{congress}/bills/#{id}/#{type}.json").parsed_response.results.first
end