rixml 0.2.2 → 0.3.0
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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/rixml.rb +13 -6
- data/rixml.gemspec +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0cfc433d3b60277f8fe8bb6a853bcd308dd4dc50
|
4
|
+
data.tar.gz: 40a4330fec5dd6c3ba30a80825d2a642cd1ec045
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dbc05133d46255f6503c8c76ffdb6909bfffcfe12d452b87b0ed74c5718ed7ce577a8704766691831f3c7f5e54adc26ecf8e15a53003ff6d435c5782afd9042e
|
7
|
+
data.tar.gz: 097921ef8bcfbbaa26755914daf85b76f1a482bfde4eeab2ddda2419744b4e5cead1885a1e293ab26d832e600853dadfcfaf3dbcd6082f2238379cb3838d3008
|
data/Gemfile.lock
CHANGED
data/lib/rixml.rb
CHANGED
@@ -119,19 +119,26 @@ class RIXML
|
|
119
119
|
companies = []
|
120
120
|
[context['IssuerDetails']].flatten.compact.each do |issuer|
|
121
121
|
[issuer['Issuer']].flatten.compact.select { |c| c['issuerType'] == 'Corporate' }.each do |company|
|
122
|
-
companies << parse_company_info(company)
|
122
|
+
companies << parse_company_info(company)
|
123
123
|
end
|
124
124
|
end
|
125
|
-
companies
|
125
|
+
companies.flatten
|
126
126
|
end
|
127
127
|
|
128
128
|
def parse_company_info(company)
|
129
|
-
|
129
|
+
securities = company.dig('SecurityDetails', 'Security')
|
130
|
+
securities = [securities].compact unless securities.is_a? Array
|
131
|
+
securities.map do |security|
|
132
|
+
info = { name: (company.dig('IssuerName') || {})['NameValue'], primary: company['primaryIndicator'] == 'Yes' }
|
133
|
+
info.merge(parse_security_info(security))
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
def parse_security_info(security)
|
138
|
+
security_ids = security.dig('SecurityID')
|
130
139
|
security_ids = [security_ids].compact unless security_ids.is_a? Array
|
131
|
-
|
140
|
+
security_ids&.map do |security_id|
|
132
141
|
{ security_id['idType'].underscore.to_sym => security_id['idValue'] }
|
133
142
|
end&.reduce({}, :merge) || []
|
134
|
-
info = { name: (company.dig('IssuerName') || {})['NameValue'] }
|
135
|
-
info.merge(ids)
|
136
143
|
end
|
137
144
|
end
|
data/rixml.gemspec
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
Gem::Specification.new do |s|
|
3
3
|
s.name = 'rixml'
|
4
|
-
s.version = '0.
|
5
|
-
s.date = '2017-
|
4
|
+
s.version = '0.3.0'
|
5
|
+
s.date = '2017-07-06'
|
6
6
|
s.summary = 'RIXML Parser'
|
7
7
|
s.description = 'Parse RIXML files'
|
8
8
|
s.homepage = 'https://github.com/AlphaExchange/rixml'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rixml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Correia Santos
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-
|
12
|
+
date: 2017-07-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|