Class: OpenCongress::OCRollCallComparison
- Inherits:
-
OpenCongressObject
- Object
- OpenCongressObject
- OpenCongress::OCRollCallComparison
- Defined in:
- lib/opencongress/roll_call_comparison.rb
Instance Attribute Summary collapse
-
#person1 ⇒ Object
Returns the value of attribute person1.
-
#person2 ⇒ Object
Returns the value of attribute person2.
-
#roll_call ⇒ Object
Returns the value of attribute roll_call.
Instance Method Summary collapse
-
#initialize(params) ⇒ OCRollCallComparison
constructor
A new instance of OCRollCallComparison.
- #set_people ⇒ Object
- #set_roll_call ⇒ Object
Methods inherited from OpenCongressObject
construct_url, hash2get, make_call, parse_supporting_results
Constructor Details
#initialize(params) ⇒ OCRollCallComparison
Returns a new instance of OCRollCallComparison.
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/opencongress/roll_call_comparison.rb', line 7 def initialize(params) params.each do |key, value| instance_variable_set("@#{key}", value) if OCRollCallComparison.instance_methods.include? key end set_people set_roll_call end |
Instance Attribute Details
#person1 ⇒ Object
Returns the value of attribute person1.
5 6 7 |
# File 'lib/opencongress/roll_call_comparison.rb', line 5 def person1 @person1 end |
#person2 ⇒ Object
Returns the value of attribute person2.
5 6 7 |
# File 'lib/opencongress/roll_call_comparison.rb', line 5 def person2 @person2 end |
#roll_call ⇒ Object
Returns the value of attribute roll_call.
5 6 7 |
# File 'lib/opencongress/roll_call_comparison.rb', line 5 def roll_call @roll_call end |
Instance Method Details
#set_people ⇒ Object
18 19 20 21 |
# File 'lib/opencongress/roll_call_comparison.rb', line 18 def set_people self.person1 = self.person1["stong"] self.person2 = self.person2["stong"] end |
#set_roll_call ⇒ Object
23 24 25 26 27 |
# File 'lib/opencongress/roll_call_comparison.rb', line 23 def set_roll_call self.roll_call = OCRollCall.new(self.roll_call) end |