api-moip-assinaturas 0.2.11 → 0.2.12
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/customer.rb +9 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZmYyYTcxMzU5MzRiZDE4YWE0ZjE0ZWIzNTIzODgxN2ViMWMxZGQ5ZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZjZiMjY0YTNmOThmYzdmNzI4YzE1MDJhMTRhYWNjZjlkZDZlNDMxMQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZjdhNGYzYjQ1OTgxZWVhYjMzMDRjMmNkYWY1ZWU3ODIwODIyMGRkZGZjNzdi
|
10
|
+
N2NiMzI0NmU3OWY4MDcyYTlmYzBkZWVhMWQ1ODI3MjNhMjY3NjAyNWNiNDJl
|
11
|
+
ZTllOGQ2MTI3YzdjZGY0NjU3N2RhZDU3Y2I1YmYwZDRhNzlkYTI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OTM4NWQ0MjY1ZmExYzBmNmZhNDc1YWViMzY2NTg4OGVhYzgzYzg5MThiZjIx
|
14
|
+
OGRlZWQyZDQ1Y2M5MTUyNDMwMWIwMjdiYzRmNTI3MWUzMGQzZDYzMWFlYjA3
|
15
|
+
MDY2MWNmODBmZDRkZjgyYmM5YjA1NzUwNjJiOGJjZWMzZjYyYzU=
|
@@ -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.12'
|
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/customer.rb
CHANGED
@@ -12,9 +12,7 @@ class Moip::Customer < Moip::Model
|
|
12
12
|
:phone_number, :birthdate_day, :birthdate_month,
|
13
13
|
:birthdate_year, :presence => true
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
validate :validates_presence_of_address, :validates_presence_of_billing_info
|
15
|
+
validate :validates_presence_of_address, :validates_presence_of_billing_info, :validates_format_of_email
|
18
16
|
|
19
17
|
def attributes
|
20
18
|
{
|
@@ -72,6 +70,14 @@ class Moip::Customer < Moip::Model
|
|
72
70
|
end
|
73
71
|
end
|
74
72
|
|
73
|
+
def validates_format_of_email
|
74
|
+
if self.email.match /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i
|
75
|
+
true
|
76
|
+
else
|
77
|
+
self.errors.add :email, I18n.t("moip.errors.invalid_format") and return
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
75
81
|
def customers= hash
|
76
82
|
@customers = []
|
77
83
|
hash.each do |e|
|