Class: GovTrack::Vote
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
#==, #eql?, find_by_id, find_by_uri, method_missing
Constructor Details
#initialize(attributes = {}) ⇒ 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)
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
|
Instance Method Details
21
22
23
|
# File 'lib/govtrack/vote.rb', line 21
def related_bill
@related_bill.class == GovTrack::Bill ? @related_bill : @related_bill = GovTrack::Bill.find_by_id(@related_bill['id'])
end
|