Class: VoteSmart::Vote
Class Method Summary collapse
-
.get_bill(bill_id) ⇒ Object
Returns detailed bill information.
-
.get_bill_action(act_id) ⇒ Object
Returns a bill’s action/stage(signed by prez, passed senate) detailed information.
-
.get_bill_action_votes(act_id) ⇒ Object
Get’s a bill’s action’s votes.
-
.get_bill_action_votes_by_official(act_id, can_id) ⇒ Object
Gets a single candidate’s vote on a bill.
-
.get_bills_by_category_year_state(category_id, year, state = 'NA') ⇒ Object
Gets a list of bills that fit the criteria.
-
.get_bills_by_official_category(can_id, category_id) ⇒ Object
Gets a list of bills that fit the criteria.
-
.get_bills_by_official_year(can_id, year) ⇒ Object
Gets a list of bills that fit the criteria.
-
.get_bills_by_sponsor_category(can_id, category_id) ⇒ Object
Gets a list of bills that fit the criteria.
-
.get_bills_by_sponsor_year(can_id, year) ⇒ Object
Gets a list of bills that fit the criteria.
-
.get_bills_by_state_recent(ammount, state_id = 'NA') ⇒ Object
Gets a list of bills that fit the criteria.
-
.get_bills_by_year_state(year, state_id = 'NA') ⇒ Object
Gets a list of bills that fit the criteria.
-
.get_categories(year, state_id = 'NA') ⇒ Object
Returns a list of categories with votes assigned for the year and state provided.
-
.get_vetoes(can_id) ⇒ Object
Gets a list of vetoes for the provided candidate.
Methods inherited from Common
construct_url, get_json_data, hash2get, #initialize, parallelize!, request, response_child, session, set_attribute_map, #update_attributes
Constructor Details
This class inherits a constructor from VoteSmart::Common
Class Method Details
.get_bill(bill_id) ⇒ Object
Returns detailed bill information
11 12 13 |
# File 'lib/vote_smart/vote.rb', line 11 def self.get_bill bill_id request("Votes.getBill", "billId" => bill_id) end |
.get_bill_action(act_id) ⇒ Object
Returns a bill’s action/stage(signed by prez, passed senate) detailed information
16 17 18 |
# File 'lib/vote_smart/vote.rb', line 16 def self.get_bill_action act_id request("Votes.getBillAction", "actionId" => act_id) end |
.get_bill_action_votes(act_id) ⇒ Object
Get’s a bill’s action’s votes
21 22 23 |
# File 'lib/vote_smart/vote.rb', line 21 def self.get_bill_action_votes act_id request("Votes.getBillActionVotes", "actionId" => act_id) end |
.get_bill_action_votes_by_official(act_id, can_id) ⇒ Object
Gets a single candidate’s vote on a bill
26 27 28 |
# File 'lib/vote_smart/vote.rb', line 26 def self.get_bill_action_votes_by_official act_id, can_id request("Votes.getBillActionVoteByOfficial", "actionId" => act_id, "candidateId" => can_id) end |
.get_bills_by_category_year_state(category_id, year, state = 'NA') ⇒ Object
Gets a list of bills that fit the criteria
31 32 33 |
# File 'lib/vote_smart/vote.rb', line 31 def self.get_bills_by_category_year_state category_id, year, state = 'NA' request("Votes.getBillsByCategoryYearState", "categoryId" => category_id, "year" => year, "stateId" => state) end |
.get_bills_by_official_category(can_id, category_id) ⇒ Object
Gets a list of bills that fit the criteria
46 47 48 |
# File 'lib/vote_smart/vote.rb', line 46 def self.get_bills_by_official_category can_id, category_id request("Votes.getBillsByOfficialCategory", "candidateId" => can_id, "categoryId" => category_id) end |
.get_bills_by_official_year(can_id, year) ⇒ Object
Gets a list of bills that fit the criteria
41 42 43 |
# File 'lib/vote_smart/vote.rb', line 41 def self.get_bills_by_official_year can_id, year request("Votes.getBillsByOfficialYear", "candidateId" => can_id, "year" => year) end |
.get_bills_by_sponsor_category(can_id, category_id) ⇒ Object
Gets a list of bills that fit the criteria
56 57 58 |
# File 'lib/vote_smart/vote.rb', line 56 def self.get_bills_by_sponsor_category can_id, category_id request("Votes.getBillsBySponsorCategory", "candiateId" => can_id, "categoryId" => category_id) end |
.get_bills_by_sponsor_year(can_id, year) ⇒ Object
Gets a list of bills that fit the criteria
51 52 53 |
# File 'lib/vote_smart/vote.rb', line 51 def self.get_bills_by_sponsor_year can_id, year request("Votes.getBillsBySponsorYear", "candidateId" => can_id, "year" => year) end |
.get_bills_by_state_recent(ammount, state_id = 'NA') ⇒ Object
Gets a list of bills that fit the criteria
61 62 63 |
# File 'lib/vote_smart/vote.rb', line 61 def self.get_bills_by_state_recent ammount, state_id = 'NA' request("Votes.getBillsByStateRecent", "stateId" => state_id, "ammount" => ammount) end |
.get_bills_by_year_state(year, state_id = 'NA') ⇒ Object
Gets a list of bills that fit the criteria
36 37 38 |
# File 'lib/vote_smart/vote.rb', line 36 def self.get_bills_by_year_state year, state_id = 'NA' request("Votes.getBillsByYearState", "year" => year, "stateId" => state_id) end |
.get_categories(year, state_id = 'NA') ⇒ Object
Returns a list of categories with votes assigned for the year and state provided
6 7 8 |
# File 'lib/vote_smart/vote.rb', line 6 def self.get_categories year, state_id = 'NA' request("Votes.getCategories", "stateId" => state_id) end |
.get_vetoes(can_id) ⇒ Object
Gets a list of vetoes for the provided candidate
66 67 68 |
# File 'lib/vote_smart/vote.rb', line 66 def self.get_vetoes can_id request("Votes.getVetoes", "candidateId" => can_id) end |