Class: GovKit::OpenStates::Bill
- Inherits:
-
GovKit::OpenStatesResource
- Object
- Resource
- GovKit::OpenStatesResource
- GovKit::OpenStates::Bill
- Defined in:
- lib/gov_kit/open_states.rb
Overview
The Bill class represents the bill data returned from Open States.
For details about fields returned, see the Open States documentation, at openstates.sunlightlabs.com/api/bills/,
Instance Attribute Summary
Attributes inherited from Resource
Class Method Summary collapse
- .find(state_abbrev, session, bill_id, chamber = '') ⇒ Object
- .latest(updated_since, ops = {}) ⇒ Object
- .search(query, options = {}) ⇒ Object
Methods inherited from GovKit::OpenStatesResource
Methods inherited from Resource
#initialize, instantiate, instantiate_collection, parse, #to_md5, #unload
Constructor Details
This class inherits a constructor from GovKit::Resource
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class GovKit::Resource
Class Method Details
.find(state_abbrev, session, bill_id, chamber = '') ⇒ Object
62 63 64 |
# File 'lib/gov_kit/open_states.rb', line 62 def self.find(state_abbrev, session, bill_id, chamber = '') get_uri("/bills/#{state_abbrev.downcase}/#{session}/#{chamber.blank? ? '' : chamber + '/'}#{bill_id}/") end |
.latest(updated_since, ops = {}) ⇒ Object
71 72 73 74 |
# File 'lib/gov_kit/open_states.rb', line 71 def self.latest(updated_since, ops = {}) result = get_uri('/bills/', :query => {:updated_since => updated_since.to_s}.merge(ops)) return Array(result) end |
.search(query, options = {}) ⇒ Object
66 67 68 69 |
# File 'lib/gov_kit/open_states.rb', line 66 def self.search(query, = {}) result = get_uri('/bills/', :query => {:q => query}.merge()) return Array(result) end |