Class: Meekster::Candidate

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

Constant Summary collapse

STATES =
[:hopeful, :withdrawn, :elected, :defeated]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = nil) ⇒ Candidate

Returns a new instance of Candidate.



8
9
10
11
12
# File 'lib/meekster/candidate.rb', line 8

def initialize(name=nil)
  self.name = name
  self.keep_factor = BigDecimal("1")
  self.votes = BigDecimal('0')
end

Instance Attribute Details

#keep_factorObject

Returns the value of attribute keep_factor.



6
7
8
# File 'lib/meekster/candidate.rb', line 6

def keep_factor
  @keep_factor
end

#nameObject

Returns the value of attribute name.



6
7
8
# File 'lib/meekster/candidate.rb', line 6

def name
  @name
end

#stateObject

Returns the value of attribute state.



6
7
8
# File 'lib/meekster/candidate.rb', line 6

def state
  @state
end

#votesObject

Returns the value of attribute votes.



6
7
8
# File 'lib/meekster/candidate.rb', line 6

def votes
  @votes
end