Class: Radventure::Money
- Inherits:
-
Object
- Object
- Radventure::Money
- Defined in:
- lib/radventure/money.rb
Overview
Represents and ingame money cache
Instance Attribute Summary collapse
-
#copper ⇒ Integer
readonly
The amount of copper for this money cache.
-
#gold ⇒ Integer
readonly
The amount of gold for this money cache.
-
#platinum ⇒ Integer
readonly
The amount of platinum for this money cache.
-
#silver ⇒ Integer
readonly
The amount of silver for this money cache.
Instance Method Summary collapse
-
#initialize(platinum, gold, silver, copper) ⇒ Money
constructor
Constructor method.
Constructor Details
#initialize(platinum, gold, silver, copper) ⇒ Money
Constructor method
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
#copper ⇒ Integer (readonly)
Returns 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 |
#gold ⇒ Integer (readonly)
Returns 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 |
#platinum ⇒ Integer (readonly)
Returns 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 |
#silver ⇒ Integer (readonly)
Returns 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 |