lib/opencongress/voting_comparison.rb in opencongress-opencongress-ruby-0.0.4 vs lib/opencongress/voting_comparison.rb in opencongress-opencongress-ruby-0.1.2

- old
+ new

@@ -1,41 +1,41 @@ module OpenCongress - class VotingComparison < OpenCongressObject + class OCVotingComparison < OpenCongressObject attr_accessor :total_votes, :same_vote, :percentage, :person1, :person2, :shared_committees, :hot_votes, :other_votes def initialize(params) params.each do |key, value| - instance_variable_set("@#{key}", value) if VotingComparison.instance_methods.include? key + instance_variable_set("@#{key}", value) if OCVotingComparison.instance_methods.include? key end set_people set_votes end def set_people - self.person1 = Person.new(self.person1["person"]) - self.person2 = Person.new(self.person2["person"]) + self.person1 = OCPerson.new(self.person1["person"]) + self.person2 = OCPerson.new(self.person2["person"]) end def set_votes these_hot_votes = [] hot_votes["vote"].each do |v| - nv = RollCallComparison.new(v) + nv = OCRollCallComparison.new(v) these_hot_votes << nv end self.hot_votes = these_hot_votes these_other_votes = [] other_votes["vote"].each do |v| - nv = RollCallComparison.new(v) + nv = OCRollCallComparison.new(v) these_other_votes << nv end self.other_votes = these_other_votes @@ -43,6 +43,6 @@ end -end \ No newline at end of file +end