capital-iq 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YzMxOGI3NmQ2N2QxOTg2NTRlZGYwNDJmNGMyODc3YjhjMDFlYjEzNQ==
4
+ MjU1ZWU0ZjA1M2IzMDc4NzAwMGM0NWE4NTBiZGY4YzM5NmRiZDhjZg==
5
5
  data.tar.gz: !binary |-
6
- ZTUwZTI5M2Y2ZDgyZDZjNzFiN2NkMzczNmUyMmJhNjFjZjlkZDg2OA==
6
+ Njk3ZDFmYjUxNDY2MGNiZTI1MmMzODgyMTQ3OTU0ZTUyN2NjNzY3Ng==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NWJkYmRkMzZhYTU2YzRjNzEwNTEwYjY2NjIyZGY4MzMwZmM2NTY3MGY0ZDA4
10
- MTg2N2FlZTFmMDA2YjIxMDI3Mjk1ZWNhMGQ4ODcyNWVmNzJlNzUxNzgwYjk4
11
- Y2U3NmRkZjY5ODI4ZDNmOGNmNmE5ZTZhYjgxMDUyOWU3YWIzZDQ=
9
+ YmYwZmM1NDc0MDNhMTIzN2UxYTJkODUxYTRkMDgwMjdiMDhhYTA4MzVmZThh
10
+ NDgzYzc5NjY4YzQwM2IyMDYxZDM2NjRiNDA5ZWQxOTgzM2I0MWZhOTVlMzJh
11
+ NjJkMmFjMGM5ODY4Yzk3ODY4ODU0MDk1OTg4ZmI1ZGQ1OWUwYTE=
12
12
  data.tar.gz: !binary |-
13
- NjUyZWU3NWE0YzJlZWNkODQyMTliYmNlMDNlOTM2ZDFjZmE2MWZjMWViNGU1
14
- OWMzOGI4YWZkZjI3ZmYyODU5M2M5Y2I1YWUwYzVmMDA0MTViZTQzNDZmMTJh
15
- MjQwNTczYTY5MjRlNjdlMTEyY2YzN2I4YjY4NjE0ZTE4MTkwZjA=
13
+ ZmIwODU3NzI5NzAxYzRmMDlmZjlhYWU1OWU3NDU3YmJiNGJjMzFmYzk2NTAy
14
+ YWRiNTJjNjhlZDVjNjQ1MzJiZmI3YThjYTk0YTYxZDY4YzZkNmZmNDU0MjZj
15
+ MDlhOTI4ZGM5MGIwNzk0ZGFkNmQyMDI2OWE1MjYzMDI0ODQ4MGE=
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.4
@@ -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.3 ruby lib
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.3"
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-06"
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 = [
@@ -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].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 = ['IQ_COMPANY_NAME']
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, 'IQ_TRANSACTION_LIST_MA', {startRank:"1", endRank:"20"})
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.3
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-06 00:00:00.000000000 Z
11
+ date: 2014-10-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty