Class: GovTrack::Vote
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Vote
constructor
A new instance of Vote.
- #related_bill ⇒ Object
Methods inherited from Base
#==, #eql?, find_by_id, find_by_uri, method_missing
Constructor Details
#initialize(attributes = {}) ⇒ Vote
Returns a new instance of Vote.
4 5 6 7 |
# File 'lib/govtrack/vote.rb', line 4 def initialize(attributes={}) super @created = DateTime.parse(@created) if @created end |
Class Method Details
.find(args) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/govtrack/vote.rb', line 9 def self.find(args) #API doesn't allow searching for bill by ID, so query with congress, bill_type, and number. if args[:related_bill] args[:related_bill__congress] = args[:related_bill].congress args[:related_bill__bill_type] = args[:related_bill].bill_type.to_bill_type_number args[:related_bill__number] = args[:related_bill].number args.delete(:related_bill) end super end |