Class: Vvm::Machine
- Inherits:
-
Object
- Object
- Vvm::Machine
- Extended by:
- Forwardable
- Defined in:
- lib/vvm/machine.rb
Constant Summary collapse
- GEM_HOME =
File.realpath(File.join(File.dirname(__FILE__), '..', '..'))
Instance Attribute Summary collapse
-
#balance ⇒ Object
Returns the value of attribute balance.
-
#coins ⇒ Object
Returns the value of attribute coins.
-
#inventory ⇒ Object
Returns the value of attribute inventory.
-
#state ⇒ Object
Returns the value of attribute state.
Instance Method Summary collapse
-
#initialize ⇒ Machine
constructor
A new instance of Machine.
Constructor Details
#initialize ⇒ Machine
Returns a new instance of Machine.
13 14 15 16 17 18 |
# File 'lib/vvm/machine.rb', line 13 def initialize @inventory = build_inventory @coins = build_coins @balance = 0 @state = Vvm::State::EmptyBalance.new(self) end |
Instance Attribute Details
#balance ⇒ Object
Returns the value of attribute balance.
9 10 11 |
# File 'lib/vvm/machine.rb', line 9 def balance @balance end |
#coins ⇒ Object
Returns the value of attribute coins.
9 10 11 |
# File 'lib/vvm/machine.rb', line 9 def coins @coins end |
#inventory ⇒ Object
Returns the value of attribute inventory.
9 10 11 |
# File 'lib/vvm/machine.rb', line 9 def inventory @inventory end |
#state ⇒ Object
Returns the value of attribute state.
9 10 11 |
# File 'lib/vvm/machine.rb', line 9 def state @state end |