Class: Vvm::State::Base
- Inherits:
-
Object
show all
- Extended by:
- Forwardable
- Defined in:
- lib/vvm/state/base.rb
Instance Method Summary
collapse
Constructor Details
#initialize(machine) ⇒ Base
Returns a new instance of Base.
10
11
12
|
# File 'lib/vvm/state/base.rb', line 10
def initialize(machine)
@machine = machine
end
|
Instance Method Details
#dispense ⇒ Object
22
23
24
25
26
27
28
|
# File 'lib/vvm/state/base.rb', line 22
def dispense
result = Vvm::Dispenser.new(balance, coins).call
machine.balance -= result.sum { _1.qty * _1.value }
result
end
|
#insert(coin) ⇒ Object
14
15
16
|
# File 'lib/vvm/state/base.rb', line 14
def insert(coin)
raise NotImplementedError
end
|
#pick(product_name) ⇒ Object
18
19
20
|
# File 'lib/vvm/state/base.rb', line 18
def pick(product_name)
raise NotImplementedError
end
|