cadun 0.2.3 → 0.2.4
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.
- data/lib/cadun/user.rb +3 -2
- data/lib/cadun/version.rb +1 -1
- data/spec/cadun/user_spec.rb +3 -0
- metadata +2 -2
data/lib/cadun/user.rb
CHANGED
@@ -11,7 +11,8 @@ module Cadun
|
|
11
11
|
"cidade/nome" => "city",
|
12
12
|
"estado/sigla" => "state",
|
13
13
|
"pais/nome" => "country",
|
14
|
-
"cep" => "zipcode"
|
14
|
+
"cep" => "zipcode",
|
15
|
+
"complemento" => "complement" }.each do |path, method|
|
15
16
|
define_method(method) { gateway.content.xpath(path).text }
|
16
17
|
end
|
17
18
|
|
@@ -38,7 +39,7 @@ module Cadun
|
|
38
39
|
end
|
39
40
|
|
40
41
|
def to_hash
|
41
|
-
%w(user_id name email user_type gender neighborhood city state country address birthday phone mobile login cpf zipcode status).inject(Hash.new(0)) { |hash, method| hash[method.to_sym] = send(method); hash }
|
42
|
+
%w(user_id name email user_type gender neighborhood city state country address birthday phone mobile login cpf zipcode status complement).inject(Hash.new(0)) { |hash, method| hash[method.to_sym] = send(method); hash }
|
42
43
|
end
|
43
44
|
|
44
45
|
def method_missing(method)
|
data/lib/cadun/version.rb
CHANGED
data/spec/cadun/user_spec.rb
CHANGED
@@ -55,6 +55,8 @@ describe Cadun::User do
|
|
55
55
|
verify_method "user_type", "NAO_ASSINANTE"
|
56
56
|
|
57
57
|
verify_method "user_id", "21737810"
|
58
|
+
|
59
|
+
verify_method "complement", "807"
|
58
60
|
end
|
59
61
|
|
60
62
|
context "when the user id is given" do
|
@@ -90,5 +92,6 @@ describe Cadun::User do
|
|
90
92
|
specify { should include(:cpf => "09532034765") }
|
91
93
|
specify { should include(:zipcode => "20510060") }
|
92
94
|
specify { should include(:status => "ATIVO") }
|
95
|
+
specify { should include(:complement => "807") }
|
93
96
|
end
|
94
97
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: cadun
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.2.
|
5
|
+
version: 0.2.4
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Bruno
|
@@ -12,7 +12,7 @@ autorequire:
|
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
14
|
|
15
|
-
date: 2011-05-
|
15
|
+
date: 2011-05-27 00:00:00 -03:00
|
16
16
|
default_executable:
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|