Class: Edoxen::VotingCounts
- Inherits:
-
Lutaml::Model::Serializable
- Object
- Lutaml::Model::Serializable
- Edoxen::VotingCounts
- Defined in:
- lib/edoxen/voting_counts.rb,
sig/edoxen.rbs
Overview
VotingCounts — tally for a Voting instance.
Instance Attribute Summary collapse
-
#absent ⇒ Integer?
readonly
Returns the value of attribute absent.
-
#abstentions ⇒ Integer?
readonly
Returns the value of attribute abstentions.
-
#ayes ⇒ Integer?
readonly
Returns the value of attribute ayes.
-
#noes ⇒ Integer?
readonly
Returns the value of attribute noes.
Instance Method Summary collapse
Instance Attribute Details
#absent ⇒ Integer? (readonly)
Returns the value of attribute absent.
216 217 218 |
# File 'sig/edoxen.rbs', line 216 def absent @absent end |
#abstentions ⇒ Integer? (readonly)
Returns the value of attribute abstentions.
215 216 217 |
# File 'sig/edoxen.rbs', line 215 def abstentions @abstentions end |
#ayes ⇒ Integer? (readonly)
Returns the value of attribute ayes.
213 214 215 |
# File 'sig/edoxen.rbs', line 213 def ayes @ayes end |
#noes ⇒ Integer? (readonly)
Returns the value of attribute noes.
214 215 216 |
# File 'sig/edoxen.rbs', line 214 def noes @noes end |
Instance Method Details
#margin ⇒ Integer
15 16 17 |
# File 'lib/edoxen/voting_counts.rb', line 15 def margin (ayes || 0) - (noes || 0) end |
#tied? ⇒ Boolean
19 20 21 |
# File 'lib/edoxen/voting_counts.rb', line 19 def tied? ayes == noes end |
#total ⇒ Integer
11 12 13 |
# File 'lib/edoxen/voting_counts.rb', line 11 def total (ayes || 0) + (noes || 0) + (abstentions || 0) + (absent || 0) end |