ivt_mellon_reader 0.4.3 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ivt_mellon_reader/client.rb +16 -7
- data/lib/ivt_mellon_reader/version.rb +1 -1
- data/lib/mellon_client.rb +1 -1
- data/lib/mellon_client_account.rb +3 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b65bb2b6f6a2969059374a87ffbf351e0d273b8
|
4
|
+
data.tar.gz: 497da5b7321d903674d96ce151e78174cb840c6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: adc22b90c21a0fc255c97c8398156df7b337e631920875d33ada7cb1a9c6998e244ccde9dfa348061f257c03149b7e6febc0bb347721aa4a28b8aa13be356d32
|
7
|
+
data.tar.gz: f379fa1c9b46e9fa23512432df429a90070adc56004c88e00353762209c6473c122a0c64557507e887b0d2666617e055dc7c6226181b94c4b870d0336db78992
|
@@ -2,6 +2,7 @@ require 'ox'
|
|
2
2
|
require 'mellon_client'
|
3
3
|
require 'mellon_client_address'
|
4
4
|
require 'mellon_client_phone'
|
5
|
+
require 'mellon_client_account'
|
5
6
|
require 'saxerator'
|
6
7
|
|
7
8
|
module IvtMellonReader
|
@@ -12,16 +13,14 @@ module IvtMellonReader
|
|
12
13
|
config.symbolize_keys!
|
13
14
|
end
|
14
15
|
|
15
|
-
|
16
|
+
@clients = @parser.for_tag(:Titularidade)
|
16
17
|
|
17
|
-
|
18
|
+
raise "Arquivo não contém nenhum cliente. Favor verifique se o formato do arquivo está correto." if @clients.to_a.empty?
|
18
19
|
|
19
20
|
@clients.each do |client|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
end
|
24
|
-
|
21
|
+
@client = client
|
22
|
+
block.call(MellonClient.new(id, name, identification_document, gender, emails, phones,
|
23
|
+
addresses, occupation, profession, birth_date, type, nav_range, accounts))
|
25
24
|
end
|
26
25
|
end
|
27
26
|
|
@@ -103,6 +102,16 @@ module IvtMellonReader
|
|
103
102
|
addresses
|
104
103
|
end
|
105
104
|
|
105
|
+
def accounts
|
106
|
+
[ @client[:Contas][:conta] ].flatten(1).map do |account|
|
107
|
+
MellonClientAccount.new(
|
108
|
+
@client[:Contas][:conta][:idConta],
|
109
|
+
@client[:Contas][:conta][:NomeCotista],
|
110
|
+
@client[:Contas][:conta][:nomeDistribuidor],
|
111
|
+
)
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
106
115
|
def birth_date
|
107
116
|
if @client[:Titular].has_key? :dataNascimento
|
108
117
|
if !@client[:Titular][:dataNascimento].empty?
|
data/lib/mellon_client.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
class MellonClient < Struct.new(:id, :name, :identification_document, :gender, :emails, :phones, :addresses, :occupation, :profession, :birth_date, :type, :nav_range)
|
1
|
+
class MellonClient < Struct.new(:id, :name, :identification_document, :gender, :emails, :phones, :addresses, :occupation, :profession, :birth_date, :type, :nav_range, :accounts)
|
2
2
|
|
3
3
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ivt_mellon_reader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lucas Pérez'
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -159,6 +159,7 @@ files:
|
|
159
159
|
- lib/ivt_mellon_reader/transaction.rb
|
160
160
|
- lib/ivt_mellon_reader/version.rb
|
161
161
|
- lib/mellon_client.rb
|
162
|
+
- lib/mellon_client_account.rb
|
162
163
|
- lib/mellon_client_address.rb
|
163
164
|
- lib/mellon_client_phone.rb
|
164
165
|
- lib/mellon_transaction.rb
|