Sha256: 42866a06f7f414bd2c0d0dd213142f9f109f4ddac7aef9d3cb503b6d0e034c3a

Contents?: true

Size: 981 Bytes

Versions: 2

Compression:

Stored size: 981 Bytes

Contents

module NYTimes
	module Congress
		class Position < Base
		  attr_reader :member_id, :vote_position, :vote
		  alias position vote_position
		  
		  VALUES = ['Yes', 'No', 'Not Voting', 'Present', 'Speaker']
		  
		  def initialize(member_id, vote_position, vote)
		    raise "Member ID required" unless member_id
		    @member_id = member_id
		    @vote_position = vote_position
		    @vote = RollCallVote.new(extra_attrs)
		  end
		  
		  def legislator
		    Legislator.find(member_id)
		  end
		  
		  def to_s
		    position
		  end
		  
		  def for?
        position == 'Yes'
		  end
		  
		  def against?
		    position == 'No'
		  end
		  
		  def not_voting?
		    position == 'Not Voting'
		  end
		  
		end
	end
end

# {"votes"=>[{"vote"=>{"chamber"=>"Senate", "time"=>"11:57:00", "date"=>"2008-06-10", "roll_call"=>"147", "session"=>"2", "member_id"=>"B001210", "congress"=>"110", "position"=>"Not Voting"}}], "total_votes"=>"100", "member_id"=>"B001210", "offset"=>"0"}

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
hoverbird-ny-times-congress-1.0.0 lib/ny-times/congress/position.rb
hoverbird-ny-times-congress-1.1.0 lib/ny-times/congress/position.rb