Class: Vvm::Machine

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initializeMachine

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

#balanceObject

Returns the value of attribute balance.



9
10
11
# File 'lib/vvm/machine.rb', line 9

def balance
  @balance
end

#coinsObject

Returns the value of attribute coins.



9
10
11
# File 'lib/vvm/machine.rb', line 9

def coins
  @coins
end

#inventoryObject

Returns the value of attribute inventory.



9
10
11
# File 'lib/vvm/machine.rb', line 9

def inventory
  @inventory
end

#stateObject

Returns the value of attribute state.



9
10
11
# File 'lib/vvm/machine.rb', line 9

def state
  @state
end