Class: NYTimes::Congress::RollCallVote
- Includes:
- AttributeTransformation
- Defined in:
- lib/ny-times/congress/roll_call_vote.rb
Constant Summary collapse
- ATTRIBUTE_MAP =
{ :date_for => [:date], :integer_for => [:session_number, :congress, :roll_call], :symbol_for => [:chamber], :string_for => [:bill_number, :question, :vote_type, :time, :result, :description], :positions_for => [:positions] }
Constants inherited from Base
Base::API_BASE, Base::API_NAME, Base::API_SERVER, Base::API_VERSION
Instance Method Summary collapse
- #get_congress ⇒ Object
-
#initialize(args = {}) ⇒ RollCallVote
constructor
A new instance of RollCallVote.
Methods included from AttributeTransformation
#date_for, #do_transformation, #empty?, #integer_for, #positions_for, #roles_for, #string_for, #symbol_for, #transform, #votes_for
Methods inherited from Base
api_key, api_key=, build_request_url, copyright, define_lazy_reader_for_attribute_named, invoke
Constructor Details
#initialize(args = {}) ⇒ RollCallVote
Returns a new instance of RollCallVote.
15 16 17 18 19 20 |
# File 'lib/ny-times/congress/roll_call_vote.rb', line 15 def initialize(args={}) transformed_values = self.transform(args, ATTRIBUTE_MAP) transformed_values.each_pair do |attribute, value| instance_variable_set("@#{attribute}", value) end end |