cieloz 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,6 +6,25 @@ module Cieloz
6
6
  def success?
7
7
  true
8
8
  end
9
+
10
+ STATUSES = {
11
+ "0" => :criada,
12
+ "1" => :em_andamento,
13
+ "2" => :autenticada,
14
+ "3" => :nao_autenticada,
15
+ "4" => :autorizada,
16
+ "5" => :nao_autorizada,
17
+ "6" => :capturada,
18
+ "9" => :cancelada,
19
+ "10" => :em_autenticacao,
20
+ "12" => :em_cancelamento
21
+ }
22
+
23
+ STATUSES.each do |_, status_type|
24
+ define_method "#{status_type}?" do
25
+ STATUSES[status] == status_type
26
+ end
27
+ end
9
28
  end
10
29
  end
11
30
  end
@@ -4,19 +4,6 @@ module Cieloz
4
4
  include ActiveModel::Serializers::Xml
5
5
  include Helpers
6
6
 
7
- STATUSES = {
8
- "0" => :criada,
9
- "1" => :em_andamento,
10
- "2" => :autenticada,
11
- "3" => :nao_autenticada,
12
- "4" => :autorizada,
13
- "5" => :nao_autorizada,
14
- "6" => :capturada,
15
- "9" => :cancelada,
16
- "10" => :em_autenticacao,
17
- "12" => :em_cancelamento
18
- }
19
-
20
7
  attr_reader :xml
21
8
 
22
9
  def self.from xml
@@ -30,12 +17,6 @@ module Cieloz
30
17
  obj.instance_variable_set :@xml, xml
31
18
  obj
32
19
  end
33
-
34
- STATUSES.each do |_, status_type|
35
- define_method "#{status_type}?" do
36
- success? and STATUSES[status] == status_type
37
- end
38
- end
39
20
  end
40
21
  end
41
22
  end
@@ -1,3 +1,3 @@
1
1
  module Cieloz
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cieloz
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: