rixml 0.4.6 → 0.4.7
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/lib/rixml.rb +23 -2
- 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: 8845e241347fc96859add967aa3f6a47cb59f7bb
|
4
|
+
data.tar.gz: 1025ab975104eb8853e7eddc5e9537c3761240f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c45dc3510cd8f756332a24bfece35c2811000bfe4fba8f3779419002321c55d8f412b08fd37322a0f4379b1c967c5a80260025b5cfafabcaa0e235b52fa8bf4
|
7
|
+
data.tar.gz: bf361daf21cdb69a8fc8dc3af66d9d2423b3e9689dfe827675f67e05893e32f5bfd49ddec6aa7e0ec80757983f1b2eb0d0d177e9a443f4bf71a7954122b581ff
|
data/lib/rixml.rb
CHANGED
@@ -84,7 +84,8 @@ class RIXML
|
|
84
84
|
companies: parse_companies_from_context(context),
|
85
85
|
sectors: parse_sectors_from_context(context),
|
86
86
|
countries: parse_countries_from_context(context),
|
87
|
-
category: parse_product_category_from_context(context)
|
87
|
+
category: parse_product_category_from_context(context),
|
88
|
+
publication_date: parse_publication_date_from_context(context)
|
88
89
|
}
|
89
90
|
end
|
90
91
|
|
@@ -113,10 +114,26 @@ class RIXML
|
|
113
114
|
middle_name: person['MiddleName'],
|
114
115
|
last_name: person['FamilyName'],
|
115
116
|
job_title: person['JobTitle'],
|
116
|
-
email: person['ContactInfo']&.dig('Email')&.downcase
|
117
|
+
email: person['ContactInfo']&.dig('Email')&.downcase, # TODO: Remove: Use email from contacts
|
118
|
+
contacts: parse_author_contacts(person['ContactInfo'])
|
117
119
|
}
|
118
120
|
end
|
119
121
|
|
122
|
+
def parse_author_contacts(contacts)
|
123
|
+
contacts = [contacts] unless contacts.is_a? Array
|
124
|
+
|
125
|
+
contacts.map do |contact|
|
126
|
+
{
|
127
|
+
email: contact&.dig('Email')&.downcase,
|
128
|
+
phone: parse_author_contact_phone(contact&.dig('Phone'))
|
129
|
+
}
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
def parse_author_contact_phone(phone)
|
134
|
+
[phone['CountryCode'], phone['Number']].join(' ') if phone
|
135
|
+
end
|
136
|
+
|
120
137
|
def parse_sectors_from_context(context)
|
121
138
|
list = context['ProductClassifications'].try(:[], 'SectorIndustry')
|
122
139
|
return [] if list.nil?
|
@@ -146,6 +163,10 @@ class RIXML
|
|
146
163
|
context.dig('ProductDetails', 'ProductCategory', 'productCategory')
|
147
164
|
end
|
148
165
|
|
166
|
+
def parse_publication_date_from_context(context)
|
167
|
+
context.dig('ProductDetails', 'publicationDateTime')
|
168
|
+
end
|
169
|
+
|
149
170
|
def parse_company_info(company)
|
150
171
|
securities = company.dig('SecurityDetails', 'Security')
|
151
172
|
securities = [securities].compact unless securities.is_a? Array
|
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.4.
|
5
|
-
s.date = '2017-09-
|
4
|
+
s.version = '0.4.7'
|
5
|
+
s.date = '2017-09-17'
|
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.
|
4
|
+
version: 0.4.7
|
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-09-
|
12
|
+
date: 2017-09-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|