Class: Smartware::Interface::Modem

Inherits:
Smartware::Interface show all
Defined in:
lib/smartware/interfaces/modem.rb

Constant Summary collapse

MODEM_NOT_AVAILABLE =
1

Instance Method Summary collapse

Constructor Details

#initialize(config, service) ⇒ Modem

Returns a new instance of Modem.



6
7
8
9
10
11
12
13
14
15
# File 'lib/smartware/interfaces/modem.rb', line 6

def initialize(config, service)
  super

  @device. = method(:account)

  update_status :balance, ''
  update_status :signal_level, ''

  @session = Thread.new &method(:poll)
end

Instance Method Details

#balanceObject



17
18
19
# File 'lib/smartware/interfaces/modem.rb', line 17

def balance
  self.status[:balance][0]
end

#signal_levelObject



21
22
23
# File 'lib/smartware/interfaces/modem.rb', line 21

def signal_level
  self.status[:signal_level][0]
end