Sha256: 958852fff8efb31b58d70e888a097cfc8a0ba1837d6b8fdf5d10acf3be2e6ff9

Contents?: true

Size: 769 Bytes

Versions: 5

Compression:

Stored size: 769 Bytes

Contents

module NYTimes
	module Congress
		class RollCallVote < Base
      include AttributeTransformation

			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]
      }    			  
      attr_reader *ATTRIBUTE_MAP.values.flatten

			def initialize(args={})
  			transformed_values = self.transform(args, ATTRIBUTE_MAP)
				transformed_values.each_pair do |attribute, value|
					instance_variable_set("@#{attribute}", value)
				end
			end
		
		  def get_congress
		    Congress.new(congress, chamber)
		  end
		  
		end
	end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
hoverbird-ny-times-congress-1.2.0 lib/ny-times/congress/roll_call_vote.rb
hoverbird-ny-times-congress-1.2.1 lib/ny-times/congress/roll_call_vote.rb
hoverbird-ny-times-congress-1.2.2 lib/ny-times/congress/roll_call_vote.rb
hoverbird-ny-times-congress-1.3.0 lib/ny-times/congress/roll_call_vote.rb
hoverbird-ny-times-congress-1.3.1 lib/ny-times/congress/roll_call_vote.rb