Class: Confidence::Participant

Inherits:
Object
  • Object
show all
Defined in:
lib/confidence.rb

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ Participant

Returns a new instance of Participant.



60
61
62
# File 'lib/confidence.rb', line 60

def initialize(attrs={})
  @attrs = attrs
end

Instance Method Details

#constituencyObject



71
# File 'lib/confidence.rb', line 71

def constituency; @attrs['Constituency']; end

#firstnameObject



68
# File 'lib/confidence.rb', line 68

def firstname;    @attrs['FirstName'];    end

#lastnameObject



69
# File 'lib/confidence.rb', line 69

def lastname;     @attrs['LastName'];     end

#partyObject



70
# File 'lib/confidence.rb', line 70

def party;        @attrs['Party'];        end

#provinceObject



72
# File 'lib/confidence.rb', line 72

def province;     @attrs['Province'];     end

#recorded_voteObject



64
65
66
# File 'lib/confidence.rb', line 64

def recorded_vote
  @recorded_vote ||= @attrs['RecordedVote'].select {|k,v| v == '1' }.first.first.downcase
end