Class: PayoutSystem::Base
- Inherits:
-
Object
- Object
- PayoutSystem::Base
- Defined in:
- lib/payout_system/base.rb,
lib/payout_system/logging.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#entries ⇒ Object
readonly
Returns the value of attribute entries.
- #logger ⇒ Object
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#order ⇒ Object
readonly
Returns the value of attribute order.
-
#pot ⇒ Object
readonly
Returns the value of attribute pot.
Instance Method Summary collapse
-
#initialize(pot, entries, order = :points, options = {}) ⇒ Base
constructor
pot
: Amount that will be awarded by the algorithm.
Constructor Details
#initialize(pot, entries, order = :points, options = {}) ⇒ Base
pot
: Amount that will be awarded by the algorithm. entries
: The objects that were staked on. Must respond to
+order+.
order
: How to rank the entries
eg :points.
12 13 14 15 16 17 |
# File 'lib/payout_system/base.rb', line 12 def initialize pot, entries, order = :points, = {} @pot = pot @entries = entries @order = order @options = end |
Instance Attribute Details
#entries ⇒ Object (readonly)
Returns the value of attribute entries.
6 7 8 |
# File 'lib/payout_system/base.rb', line 6 def entries @entries end |
#logger ⇒ Object
15 16 17 |
# File 'lib/payout_system/logging.rb', line 15 def logger @logger ||= PayoutSystem.logger end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/payout_system/base.rb', line 6 def @options end |
#order ⇒ Object (readonly)
Returns the value of attribute order.
6 7 8 |
# File 'lib/payout_system/base.rb', line 6 def order @order end |
#pot ⇒ Object (readonly)
Returns the value of attribute pot.
6 7 8 |
# File 'lib/payout_system/base.rb', line 6 def pot @pot end |