api-moip-assinaturas 0.2.17 → 0.2.18
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 +8 -8
- data/api_moip_assinaturas.gemspec +1 -1
- data/lib/moip/models/address.rb +17 -2
- data/lib/moip/models/billing_info.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YzhkNzk2YzFlNzYyZmQ2Y2FmODYwZWM4ZTY5ZjFkNmQyNTBiYjMxNQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZWU0MTI5M2YyYTZmNTY0YzA0YWJlZmUwMGQ5ZDQ1NDA2MTExYWI4Yg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OTFlMjQ4ZDI3MWE2NDQxMTcyMWQ0MGM0OGZlMDMyZjU4YWEyNjcxYmJmZDlm
|
10
|
+
M2I2ZDgyY2JlZTdlYWI4NzkzODlkMTk4OWViMTQwMTZhMWFkMjkwNTBjZmMx
|
11
|
+
OTY0ZjBmYzg4ZTAxZWIwNzgxYmI4MGNmYjcwOGJmOWMxZmQxNzI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NGQ0NGVmZjkxYTYwMTkzZGQzOTA4N2FmNTI2NWI0N2NiMzgwNzYxZDgwNjdm
|
14
|
+
NzQ4NmVmMzhmMWU3NzM2YmEyOTNjOTdiMTA2NmVkODM0MGZlMWI3MGMyYzA0
|
15
|
+
OGZhOTBjYmE4MGViZTIxYzRlZGVmNmI4ZjE5ZDhmYWFjZDU4ODA=
|
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = 'api-moip-assinaturas'
|
6
|
-
s.version = '0.2.
|
6
|
+
s.version = '0.2.18'
|
7
7
|
s.date = '2013-07-02'
|
8
8
|
s.summary = "Moip Assinaturas by Pixxel"
|
9
9
|
s.description = "Gem desenvolvida para atender aos requisitos do moip api de assinaturas"
|
data/lib/moip/models/address.rb
CHANGED
@@ -7,8 +7,23 @@ class Moip::Address < Moip::Model
|
|
7
7
|
:district, :city, :state, :country,
|
8
8
|
:zipcode, :presence => true
|
9
9
|
|
10
|
-
|
11
|
-
|
10
|
+
validate :validates_format_of_number, :validates_format_of_zipcode
|
11
|
+
|
12
|
+
def validates_format_of_number
|
13
|
+
if self.number.to_s.match /[0-9]{2}/
|
14
|
+
true
|
15
|
+
else
|
16
|
+
self.errors.add :number, I18n.t("moip.errors.invalid_format")
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def validates_format_of_zipcode
|
21
|
+
if self.zipcode.to_s.match /[0-9]{2}/
|
22
|
+
true
|
23
|
+
else
|
24
|
+
self.errors.add :zipcode, I18n.t("moip.errors.invalid_format")
|
25
|
+
end
|
26
|
+
end
|
12
27
|
|
13
28
|
def attributes
|
14
29
|
{
|
@@ -4,7 +4,7 @@ class Moip::BillingInfo < Moip::Model
|
|
4
4
|
|
5
5
|
validates :holder_name, :number, :expiration_month, :expiration_year, :presence => true
|
6
6
|
|
7
|
-
validate :
|
7
|
+
validate :validates_format_of_number, :valida_numero_cartao,
|
8
8
|
:validates_format_of_expiration_month, :validates_format_of_expiration_year
|
9
9
|
|
10
10
|
def validates_format_of_number
|