Class: Sorare::Rewards::Player::Supply

Inherits:
Struct
  • Object
show all
Defined in:
lib/sorare/rewards/player.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(overall: 0, projected: 0, cooldowned: 0, limited: 0) ⇒ Supply

Returns a new instance of Supply.



13
14
15
# File 'lib/sorare/rewards/player.rb', line 13

def initialize(overall: 0, projected: 0, cooldowned: 0, limited: 0)
  super(overall: overall, projected: projected, cooldowned: cooldowned, limited: limited)
end

Instance Attribute Details

#cooldownedObject

Returns the value of attribute cooldowned

Returns:

  • (Object)

    the current value of cooldowned



12
13
14
# File 'lib/sorare/rewards/player.rb', line 12

def cooldowned
  @cooldowned
end

#limitedObject

Returns the value of attribute limited

Returns:

  • (Object)

    the current value of limited



12
13
14
# File 'lib/sorare/rewards/player.rb', line 12

def limited
  @limited
end

#overallObject

Returns the value of attribute overall

Returns:

  • (Object)

    the current value of overall



12
13
14
# File 'lib/sorare/rewards/player.rb', line 12

def overall
  @overall
end

#projectedObject

Returns the value of attribute projected

Returns:

  • (Object)

    the current value of projected



12
13
14
# File 'lib/sorare/rewards/player.rb', line 12

def projected
  @projected
end

Instance Method Details

#availableObject



21
22
23
# File 'lib/sorare/rewards/player.rb', line 21

def available
  [overall, cooldowned, limited].min || 0
end

#pool_contributionObject



17
18
19
# File 'lib/sorare/rewards/player.rb', line 17

def pool_contribution
  [projected, available].min || 0
end