Class: Superbowl::Contestant

Inherits:
Struct
  • Object
show all
Defined in:
lib/superbowl/contestant.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#expected_payoutObject

Returns the value of attribute expected_payout

Returns:

  • (Object)

    the current value of expected_payout



3
4
5
# File 'lib/superbowl/contestant.rb', line 3

def expected_payout
  @expected_payout
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



3
4
5
# File 'lib/superbowl/contestant.rb', line 3

def name
  @name
end

#num_squaresObject

Returns the value of attribute num_squares

Returns:

  • (Object)

    the current value of num_squares



3
4
5
# File 'lib/superbowl/contestant.rb', line 3

def num_squares
  @num_squares
end

Instance Method Details

#expected_roiObject



8
9
10
# File 'lib/superbowl/contestant.rb', line 8

def expected_roi
  100 * (expected_payout - total_investment) / total_investment
end

#total_investmentObject



4
5
6
# File 'lib/superbowl/contestant.rb', line 4

def total_investment
  10.0 * num_squares
end