Class: PayoutSystem::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/payout_system/base.rb,
lib/payout_system/logging.rb

Direct Known Subclasses

MinimumToFraction, PodiumSplit, WinnerTakesAll

Instance Attribute Summary collapse

Instance Method Summary collapse

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, options = {}
  @pot = pot
  @entries = entries
  @order = order
  @options = options
end

Instance Attribute Details

#entriesObject (readonly)

Returns the value of attribute entries.



6
7
8
# File 'lib/payout_system/base.rb', line 6

def entries
  @entries
end

#loggerObject



15
16
17
# File 'lib/payout_system/logging.rb', line 15

def logger
  @logger ||= PayoutSystem.logger
end

#optionsObject (readonly)

Returns the value of attribute options.



6
7
8
# File 'lib/payout_system/base.rb', line 6

def options
  @options
end

#orderObject (readonly)

Returns the value of attribute order.



6
7
8
# File 'lib/payout_system/base.rb', line 6

def order
  @order
end

#potObject (readonly)

Returns the value of attribute pot.



6
7
8
# File 'lib/payout_system/base.rb', line 6

def pot
  @pot
end