capital-iq 0.0.3 → 0.0.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.
- checksums.yaml +8 -8
- data/VERSION +1 -1
- data/capital-iq.gemspec +3 -3
- data/lib/capital-iq/base.rb +9 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MjU1ZWU0ZjA1M2IzMDc4NzAwMGM0NWE4NTBiZGY4YzM5NmRiZDhjZg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
Njk3ZDFmYjUxNDY2MGNiZTI1MmMzODgyMTQ3OTU0ZTUyN2NjNzY3Ng==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YmYwZmM1NDc0MDNhMTIzN2UxYTJkODUxYTRkMDgwMjdiMDhhYTA4MzVmZThh
|
10
|
+
NDgzYzc5NjY4YzQwM2IyMDYxZDM2NjRiNDA5ZWQxOTgzM2I0MWZhOTVlMzJh
|
11
|
+
NjJkMmFjMGM5ODY4Yzk3ODY4ODU0MDk1OTg4ZmI1ZGQ1OWUwYTE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZmIwODU3NzI5NzAxYzRmMDlmZjlhYWU1OWU3NDU3YmJiNGJjMzFmYzk2NTAy
|
14
|
+
YWRiNTJjNjhlZDVjNjQ1MzJiZmI3YThjYTk0YTYxZDY4YzZkNmZmNDU0MjZj
|
15
|
+
MDlhOTI4ZGM5MGIwNzk0ZGFkNmQyMDI2OWE1MjYzMDI0ODQ4MGE=
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.4
|
data/capital-iq.gemspec
CHANGED
@@ -2,15 +2,15 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: capital-iq 0.0.
|
5
|
+
# stub: capital-iq 0.0.4 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "capital-iq"
|
9
|
-
s.version = "0.0.
|
9
|
+
s.version = "0.0.4"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.authors = ["Ian Morgan"]
|
13
|
-
s.date = "2014-10-
|
13
|
+
s.date = "2014-10-08"
|
14
14
|
s.description = "Ruby wrapper for the CapIQ API"
|
15
15
|
s.email = "ian@ruby-code.com"
|
16
16
|
s.extra_rdoc_files = [
|
data/lib/capital-iq/base.rb
CHANGED
@@ -11,9 +11,10 @@ module CapitalIQ
|
|
11
11
|
def request(function, identifier, mnemonic, properties)
|
12
12
|
request_body = Request.new(function, identifier, mnemonic, properties).request
|
13
13
|
response_data = self.class.post(ENDPOINT, body: request_body, basic_auth: @auth, ssl_version: :SSLv3).parsed_response
|
14
|
-
response = response_data[response_data.keys.first]
|
14
|
+
response = response_data[response_data.keys.first]
|
15
|
+
return nil if response.nil?
|
15
16
|
raise CapitalIQ::APIError, response['ErrMsg'] if response['ErrMsg']
|
16
|
-
response
|
17
|
+
response.first
|
17
18
|
end
|
18
19
|
|
19
20
|
def gdst_request(identifier, mnemonic)
|
@@ -42,18 +43,18 @@ module CapitalIQ
|
|
42
43
|
|
43
44
|
def transaction_list(identifier)
|
44
45
|
transaction_items = ['IQ_TR_TARGET_ID', 'IQ_TR_BUYER_ID', 'IQ_TR_SELLER_ID', 'IQ_TR_STATUS', 'IQ_TR_CLOSED_DATE', 'IQ_TR_IMPLIED_EV_FINAL']
|
45
|
-
walk_transactions(identifier, transaction_items)
|
46
|
+
walk_transactions(identifier, 'IQ_TRANSACTION_LIST_MA', transaction_items)
|
46
47
|
end
|
47
48
|
|
48
49
|
def pe_transactions(identifier)
|
49
|
-
transaction_items = ['
|
50
|
-
walk_transactions(identifier, transaction_items)
|
50
|
+
transaction_items = ['IQ_PRIMARY_SIC_CODE', 'IQ_EMPLOYEES']
|
51
|
+
walk_transactions(identifier, 'IQ_INVESTMENTS_ALL_ID', transaction_items)
|
51
52
|
end
|
52
53
|
|
53
54
|
private
|
54
|
-
def walk_transactions(identifier, transaction_items)
|
55
|
+
def walk_transactions(identifier, list_identifier, transaction_items)
|
55
56
|
acquisitions = {}
|
56
|
-
transaction_list = request('GDSHE', identifier,
|
57
|
+
transaction_list = request('GDSHE', identifier, list_identifier, {startRank:"1", endRank:"20"})
|
57
58
|
return nil if transaction_list['Rows'].first["Row"].first == 'Data Unavailable'
|
58
59
|
transaction_list['Rows'].each do |transaction|
|
59
60
|
acquisitions[transaction['Row'].first] = transaction_items.map {|transaction_item|
|
@@ -64,7 +65,7 @@ module CapitalIQ
|
|
64
65
|
else
|
65
66
|
a['Row'].first
|
66
67
|
end
|
67
|
-
}.first
|
68
|
+
}.first
|
68
69
|
]
|
69
70
|
}.reduce({}, :merge)
|
70
71
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capital-iq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ian Morgan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|