Module: Smartware

Defined in:
lib/smartware.rb,
lib/smartware/client.rb,
lib/smartware/logging.rb,
lib/smartware/service.rb,
lib/smartware/version.rb,
lib/smartware/pub_sub_client.rb,
lib/smartware/pub_sub_server.rb,
lib/smartware/process_manager.rb,
lib/smartware/interfaces/modem.rb,
lib/smartware/connection_monitor.rb,
lib/smartware/interfaces/pin_pad.rb,
lib/smartware/interfaces/printer.rb,
lib/smartware/drivers/modem/dummy.rb,
lib/smartware/interfaces/watchdog.rb,
lib/smartware/interfaces/interface.rb,
lib/smartware/drivers/pin_pad/zt588.rb,
lib/smartware/drivers/printer/dummy.rb,
lib/smartware/drivers/modem/standard.rb,
lib/smartware/drivers/watchdog/dummy.rb,
lib/smartware/interfaces/card_reader.rb,
lib/smartware/drivers/printer/esc_pos.rb,
lib/smartware/interfaces/cash_acceptor.rb,
lib/smartware/drivers/card_reader/dummy.rb,
lib/smartware/interfaces/user_interface.rb,
lib/smartware/drivers/user_interface/x11.rb,
lib/smartware/drivers/card_reader/ict3_k5.rb,
lib/smartware/drivers/cash_acceptor/ccnet.rb,
lib/smartware/drivers/cash_acceptor/dummy.rb,
lib/smartware/drivers/user_interface/dummy.rb,
lib/smartware/drivers/common/szzt_connection.rb,
lib/smartware/drivers/common/ccnet_connection.rb,
lib/smartware/drivers/common/sankyo_connection.rb,
lib/smartware/drivers/watchdog/watchdog_daemon.rb,
lib/smartware/drivers/common/command_based_device.rb

Defined Under Namespace

Modules: Client, Driver, Interface, Logging, ProcessManager Classes: CCNETConnection, CommandBasedDevice, ConnectionMonitor, PubSubClient, PubSubServer, SZZTConnection, SankyoConnection, Service

Constant Summary collapse

VERSION =
"0.4.12"

Class Method Summary collapse

Class Method Details

.card_readerObject



50
51
52
# File 'lib/smartware.rb', line 50

def self.card_reader
  Smartware::Client.instance('druby://localhost:6004')
end

.cash_acceptorObject



38
39
40
# File 'lib/smartware.rb', line 38

def self.cash_acceptor
  Smartware::Client.instance('druby://localhost:6001')
end

.devices {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (Smartware)

    the object that the method was called on



34
35
36
# File 'lib/smartware.rb', line 34

def self.devices
  yield self
end

.modemObject



42
43
44
# File 'lib/smartware.rb', line 42

def self.modem
  Smartware::Client.instance('druby://localhost:6002')
end

.pin_padObject



58
59
60
# File 'lib/smartware.rb', line 58

def self.pin_pad
  Smartware::Client.instance('druby://localhost:6006')
end

.printerObject



54
55
56
# File 'lib/smartware.rb', line 54

def self.printer
  Smartware::Client.instance('druby://localhost:6005')
end

.subscribe(&block) ⇒ Object



66
67
68
69
70
71
72
# File 'lib/smartware.rb', line 66

def self.subscribe(&block)
  Smartware::PubSubClient.destroy_static_client
  client = Smartware::PubSubClient.create_static_client
  client.receiver = block
  client.start
  client
end

.unsubscribeObject



74
75
76
# File 'lib/smartware.rb', line 74

def self.unsubscribe
  Smartware::PubSubClient.destroy_static_client
end

.user_interfaceObject



62
63
64
# File 'lib/smartware.rb', line 62

def self.user_interface
    Smartware::Client.instance('druby://localhost:6007')
end

.watchdogObject



46
47
48
# File 'lib/smartware.rb', line 46

def self.watchdog
  Smartware::Client.instance('druby://localhost:6003')
end