Class: Smartware::Driver::CashAcceptor::Dummy
- Inherits:
-
Object
- Object
- Smartware::Driver::CashAcceptor::Dummy
- Defined in:
- lib/smartware/drivers/cash_acceptor/dummy.rb
Instance Attribute Summary collapse
-
#bill_types ⇒ Object
readonly
Returns the value of attribute bill_types.
-
#closed ⇒ Object
Returns the value of attribute closed.
-
#enabled_types ⇒ Object
Returns the value of attribute enabled_types.
-
#escrow ⇒ Object
Returns the value of attribute escrow.
-
#open ⇒ Object
Returns the value of attribute open.
-
#returned ⇒ Object
Returns the value of attribute returned.
-
#stacked ⇒ Object
Returns the value of attribute stacked.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
- #accepting? ⇒ Boolean
- #eject_casette ⇒ Object
-
#initialize(config) ⇒ Dummy
constructor
A new instance of Dummy.
- #insert_casette ⇒ Object
- #model ⇒ Object
- #version ⇒ Object
Constructor Details
#initialize(config) ⇒ Dummy
Returns a new instance of Dummy.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/smartware/drivers/cash_acceptor/dummy.rb', line 12 def initialize(config) @bill_types = [ 10, 50, 100, 500, 5000 ].map do |value| Interface::CashAcceptor::BillType.new(value, 'RUS') end @open = nil @closed = nil @escrow = nil @stacked = nil @returned = nil @status = nil @escrow_bill = nil @casette = true @enabled_types = 0 EventMachine.add_periodic_timer 0.5, method(:poll) @dummy_state = :power_up end |
Instance Attribute Details
#bill_types ⇒ Object (readonly)
Returns the value of attribute bill_types.
7 8 9 |
# File 'lib/smartware/drivers/cash_acceptor/dummy.rb', line 7 def bill_types @bill_types end |
#closed ⇒ Object
Returns the value of attribute closed.
9 10 11 |
# File 'lib/smartware/drivers/cash_acceptor/dummy.rb', line 9 def closed @closed end |
#enabled_types ⇒ Object
Returns the value of attribute enabled_types.
10 11 12 |
# File 'lib/smartware/drivers/cash_acceptor/dummy.rb', line 10 def enabled_types @enabled_types end |
#escrow ⇒ Object
Returns the value of attribute escrow.
9 10 11 |
# File 'lib/smartware/drivers/cash_acceptor/dummy.rb', line 9 def escrow @escrow end |
#open ⇒ Object
Returns the value of attribute open.
9 10 11 |
# File 'lib/smartware/drivers/cash_acceptor/dummy.rb', line 9 def open @open end |
#returned ⇒ Object
Returns the value of attribute returned.
9 10 11 |
# File 'lib/smartware/drivers/cash_acceptor/dummy.rb', line 9 def returned @returned end |
#stacked ⇒ Object
Returns the value of attribute stacked.
9 10 11 |
# File 'lib/smartware/drivers/cash_acceptor/dummy.rb', line 9 def stacked @stacked end |
#status ⇒ Object
Returns the value of attribute status.
9 10 11 |
# File 'lib/smartware/drivers/cash_acceptor/dummy.rb', line 9 def status @status end |
Instance Method Details
#accepting? ⇒ Boolean
41 42 43 |
# File 'lib/smartware/drivers/cash_acceptor/dummy.rb', line 41 def accepting? false end |
#eject_casette ⇒ Object
49 50 51 |
# File 'lib/smartware/drivers/cash_acceptor/dummy.rb', line 49 def eject_casette @casette = false end |
#insert_casette ⇒ Object
45 46 47 |
# File 'lib/smartware/drivers/cash_acceptor/dummy.rb', line 45 def insert_casette @casette = true end |
#model ⇒ Object
33 34 35 |
# File 'lib/smartware/drivers/cash_acceptor/dummy.rb', line 33 def model "Generic cash acceptor" end |
#version ⇒ Object
37 38 39 |
# File 'lib/smartware/drivers/cash_acceptor/dummy.rb', line 37 def version "1.0" end |