smartware 0.1.22 → 0.1.23

Sign up to get free protection for your applications and to get access to all the features.
@@ -20,6 +20,10 @@ module Smartware
20
20
  @device.status
21
21
  end
22
22
 
23
+ def self.error
24
+ @device.error
25
+ end
26
+
23
27
  def self.model
24
28
  @device.model
25
29
  end
@@ -10,7 +10,7 @@ module Smartware
10
10
  end
11
11
 
12
12
  def model
13
- "Dummy cash acceptor v1.0"
13
+ "Generic cash acceptor"
14
14
  end
15
15
 
16
16
  def cassette?
@@ -10,7 +10,7 @@ module Smartware
10
10
  end
11
11
 
12
12
  def model
13
- 'Dummy modem v1.0'
13
+ 'Generic modem'
14
14
  end
15
15
 
16
16
  def error
@@ -18,16 +18,12 @@ module Smartware
18
18
  end
19
19
 
20
20
  def signal_level
21
- "-#{rand(90)*10+rand(9)} dbm"
21
+ res = %w(-55 -51 -57 -53).sample
22
+ "#{res} dbm"
22
23
  end
23
24
 
24
- #
25
- # Method send ussd to operator and return only valid answer body
26
- # Don`t call with method synchronously from app, method waits USSD answer 3 sec,
27
- # Use some scheduler and buffer for balance value
28
- #
29
25
  def ussd(code="*100#")
30
- "#{rand(90)*100+rand(9)} " + %w(руб. dollars тэньге).sample
26
+ "Сервис временно недоступен"
31
27
  end
32
28
 
33
29
  end
@@ -41,6 +41,7 @@ module Smartware
41
41
  "#{(-113 + value * 2)} dbm"
42
42
  rescue
43
43
  @error = ERRORS["21"]
44
+ return false
44
45
  end
45
46
 
46
47
  #
@@ -14,7 +14,7 @@ module Smartware
14
14
  end
15
15
 
16
16
  def model
17
- 'Dummy printer'
17
+ 'Generic printer'
18
18
  end
19
19
 
20
20
  end
@@ -58,6 +58,10 @@ module Smartware
58
58
  @configured
59
59
  end
60
60
 
61
+ def self.error
62
+ @status[:error] || ''
63
+ end
64
+
61
65
  def self.status
62
66
  @status
63
67
  end
@@ -1,3 +1,3 @@
1
1
  module Smartware
2
- VERSION = "0.1.22"
2
+ VERSION = "0.1.23"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smartware
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.22
4
+ version: 0.1.23
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-01-02 00:00:00.000000000 Z
13
+ date: 2013-01-09 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: serialport