Class: Radventure::Money

Inherits:
Object
  • Object
show all
Defined in:
lib/radventure/money.rb

Overview

Represents and ingame money cache

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(platinum, gold, silver, copper) ⇒ Money

Constructor method

Parameters:

  • platinum (Integer)

    The amount of platinum for this money cache

  • gold (Integer)

    The amount of gold for this money cache

  • silver (Integer)

    The amount of silver for this money cache

  • copper (Integer)

    The amount of copper for this money cache



24
25
26
27
28
29
# File 'lib/radventure/money.rb', line 24

def initialize(platinum, gold, silver, copper)
  @platinum = platinum.to_i
  @gold = gold.to_i
  @silver = silver.to_i
  @copper = copper.to_i
end

Instance Attribute Details

#copperInteger (readonly)

Returns The amount of copper for this money cache.

Returns:

  • (Integer)

    The amount of copper for this money cache



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/radventure/money.rb', line 14

class Money
  attr_reader :platinum, :gold, :silver, :copper

  # Constructor method
  #
  # @param platinum [Integer] The amount of platinum for this money cache
  # @param gold [Integer] The amount of gold for this money cache
  # @param silver [Integer] The amount of silver for this money cache
  # @param copper [Integer] The amount of copper for this money cache
  # @return [Money] Money object
  def initialize(platinum, gold, silver, copper)
    @platinum = platinum.to_i
    @gold = gold.to_i
    @silver = silver.to_i
    @copper = copper.to_i
  end
end

#goldInteger (readonly)

Returns The amount of gold for this money cache.

Returns:

  • (Integer)

    The amount of gold for this money cache



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/radventure/money.rb', line 14

class Money
  attr_reader :platinum, :gold, :silver, :copper

  # Constructor method
  #
  # @param platinum [Integer] The amount of platinum for this money cache
  # @param gold [Integer] The amount of gold for this money cache
  # @param silver [Integer] The amount of silver for this money cache
  # @param copper [Integer] The amount of copper for this money cache
  # @return [Money] Money object
  def initialize(platinum, gold, silver, copper)
    @platinum = platinum.to_i
    @gold = gold.to_i
    @silver = silver.to_i
    @copper = copper.to_i
  end
end

#platinumInteger (readonly)

Returns The amount of platinum for this money cache.

Returns:

  • (Integer)

    The amount of platinum for this money cache



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/radventure/money.rb', line 14

class Money
  attr_reader :platinum, :gold, :silver, :copper

  # Constructor method
  #
  # @param platinum [Integer] The amount of platinum for this money cache
  # @param gold [Integer] The amount of gold for this money cache
  # @param silver [Integer] The amount of silver for this money cache
  # @param copper [Integer] The amount of copper for this money cache
  # @return [Money] Money object
  def initialize(platinum, gold, silver, copper)
    @platinum = platinum.to_i
    @gold = gold.to_i
    @silver = silver.to_i
    @copper = copper.to_i
  end
end

#silverInteger (readonly)

Returns The amount of silver for this money cache.

Returns:

  • (Integer)

    The amount of silver for this money cache



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/radventure/money.rb', line 14

class Money
  attr_reader :platinum, :gold, :silver, :copper

  # Constructor method
  #
  # @param platinum [Integer] The amount of platinum for this money cache
  # @param gold [Integer] The amount of gold for this money cache
  # @param silver [Integer] The amount of silver for this money cache
  # @param copper [Integer] The amount of copper for this money cache
  # @return [Money] Money object
  def initialize(platinum, gold, silver, copper)
    @platinum = platinum.to_i
    @gold = gold.to_i
    @silver = silver.to_i
    @copper = copper.to_i
  end
end