spf_barcode 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YjY1Yzc4NDBmYjhiNmY1MThkZjdmZDgwYWMwNzQ4YTA4YmJiYWY0MA==
4
+ YTE3NzRiNGMzOTU5ZDQ1OTVmNDI4NmE3OTZkZTQ1YTlhZjA3N2U0Yg==
5
5
  data.tar.gz: !binary |-
6
- NTNmYTU3ZTJhY2M0OTMwNjQxZWE5NmJjOTA1NDA4ZTEwYmIzZTRiNg==
6
+ NTQ2MzRhYThhYjBlNDY5ZWIzMzc1YTVjYzFjNmFhMmQ2M2Q4MjRlMA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YjA0ZWVmZDU3ODY5NmY1MTYxYTE0MWJkOGVkNWM2YjQ1ODFkOGJiMWY3NzQy
10
- MThlNDBlYTZmN2FlOTQ2ODUzN2I2ZDNlMjQ3OGNhM2Q5NWUyZGMwNWQxYjZj
11
- ODE3N2M5MDJjOTMwM2Q4M2VlYWExNmE3OWI2ZTMzMDZkYTMwMTI=
9
+ ZGRjMjc3ZTE3ZDE5NThiNzJjNzcxM2RiYTM4ZWQ2ODA4OTIzY2ZmNjY1Mzg4
10
+ Y2QyYzM5ZDgxMDM4N2YxMzhlNTY2MjI2ZmYzZDA0ZWI5OWFhMWVjOTYzZDJm
11
+ YmMyNzU2NDZjNjA2MjVlY2Y0MzNlN2YyZTRmYjFiNmQ3NzJmNjU=
12
12
  data.tar.gz: !binary |-
13
- OTY5Mjk3YmI1MmE5MzkyNmVjOGZmY2UyMDVmYTIxYmQxY2QxNWQ0OTExOTAz
14
- NWRkYmFlZGVjZjY1OWM2ODc5MDIyMDM5NGMxMjZhZjkwMjM1OTQ3NzYyZDQy
15
- ZTM5M2FiNjNjNTViMTg0OTUyMDg2YjkwNzI1ZjIyMGI4Zjg3ZDE=
13
+ M2E2ODdmMTRhMTI4ZTEwM2RmYWM4MmU1YTM1MzVhYTVhZDEyY2FjZjRmMGI1
14
+ ODMwMDI4YjY3OTM2MjJmMTkyNjVkNzk4NDFkOWE2ZTY4ODJmZDFlNTRkNTYw
15
+ YzgxYzIxNWI0OTE1NWFkOTRlZmNiMDUyMDkwYmYxNDBhZjIyZWE=
@@ -1,3 +1,3 @@
1
1
  module SpfBarcode
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
data/lib/spf_barcode.rb CHANGED
@@ -46,39 +46,14 @@ class BarcodeOptimaDecode
46
46
 
47
47
  def decode
48
48
 
49
- if @barcode.length == 5
50
- case @barcode
51
- when '*900*' then @accion = 'OK'
52
- when '*901*' then @accion = 'ROTURA'
53
-
54
- when '*903*' then @accion = 'CONFIRMAROTURA'
55
- when '*904*' then @accion = 'CANCELAROTURA'
56
-
57
- when '*501*' then @accion = 'SELECCIONAR1'
58
- when '*502*' then @accion = 'SELECCIONAR2'
59
- when '*503*' then @accion = 'SELECCIONAR3'
60
- when '*504*' then @accion = 'SELECCIONAR4'
61
- when '*505*' then @accion = 'SELECCIONAR5'
62
- when '*506*' then @accion = 'SELECCIONAR6'
63
- when '*601*' then @accion = 'MOTIVO01'
64
- when '*602*' then @accion = 'MOTIVO02'
65
- when '*603*' then @accion = 'MOTIVO03'
66
- when '*604*' then @accion = 'MOTIVO04'
67
- when '*605*' then @accion = 'MOTIVO05'
68
- when '*606*' then @accion = 'MOTIVO06'
69
- when '*607*' then @accion = 'MOTIVO07'
70
- when '*608*' then @accion = 'MOTIVO08'
71
- when '*609*' then @accion = 'MOTIVO09'
72
-
73
- when '*701*' then @accion = 'MOMENTO01'
74
- when '*702*' then @accion = 'MOMENTO02'
75
- when '*703*' then @accion = 'MOMENTO03'
76
- when '*704*' then @accion = 'MOMENTO04'
77
- when '*705*' then @accion = 'MOMENTO05'
78
- when '*706*' then @accion = 'MOMENTO06'
79
- when '*707*' then @accion = 'MOMENTO07'
80
- when '*708*' then @accion = 'MOMENTO08'
81
- when '*709*' then @accion = 'MOMENTO09'
49
+ if @barcode[/\*\d\d\d\*/]
50
+ @tipo = @barcode[1]
51
+ @numero = @barcode[2..3].to_i.to_s # 01=> 1
52
+ case @tipo
53
+ when '9' then @accion = 'ROTURA'
54
+ when '7' then @accion = 'MOMENTO'
55
+ when '6' then @accion = 'MOTIVO'
56
+ when '5' then @accion = 'SELECCIONAR'
82
57
  end
83
58
  else
84
59
 
@@ -90,9 +65,14 @@ class BarcodeOptimaDecode
90
65
  self
91
66
  end
92
67
 
68
+ # PARA LOS CODIGOS DE BARRA, SE LES PIDE ACCION Y NUMERO
93
69
  def accion
94
70
  @accion
95
71
  end
72
+ def numero
73
+ @numero
74
+ end
75
+ ########################################################
96
76
 
97
77
  def pedido
98
78
  @pedido
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spf_barcode
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carlos Ramseyer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-22 00:00:00.000000000 Z
11
+ date: 2016-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails