Sha256: 0aa02d4050ef8aa3011e2eff0bb982a82acc604c2440abe32925aec37288aeb4

Contents?: true

Size: 581 Bytes

Versions: 7

Compression:

Stored size: 581 Bytes

Contents

module NYTimes
	module Congress
		class Role < Base
		  include AttributeTransformation
      
  		ATTRIBUTE_MAP = { :date_for    =>  [:start_date, :end_date],
                			  :integer_for =>  [:district, :congress],
                			  :string_for  =>  [:party, :chamber, :title, :state] }
    
      attr_reader *ATTRIBUTE_MAP.values.flatten
      
			def initialize(args={})
  			transformed_values = transform(args, ATTRIBUTE_MAP)
				transformed_values.each_pair do |attribute, value|
					instance_variable_set("@#{attribute}", value)
				end
			end
			
	  end
	end
end

Version data entries

7 entries across 7 versions & 1 rubygems

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