crunchbase-ruby-library 0.0.6 → 0.0.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.
@@ -20,6 +20,7 @@ module Crunchbase
20
20
  autoload :FundRaise, "crunchbase/model/fund_raise"
21
21
  autoload :FundedOrganization, "crunchbase/model/funded_organization"
22
22
  autoload :FundingRound, "crunchbase/model/funding_round"
23
+ autoload :FundingRoundOrganization, "crunchbase/model/funding_round_organization"
23
24
  autoload :Headquarter, "crunchbase/model/headquarter"
24
25
  autoload :Image, "crunchbase/model/image"
25
26
  autoload :Investment, "crunchbase/model/investment"
@@ -22,7 +22,19 @@ module Crunchbase::Model
22
22
 
23
23
  unless (relationships = json['relationships']).nil?
24
24
  set_relationships_object(Crunchbase::Model::Investment, 'investments', relationships['investments'])
25
- set_relationships_object(Crunchbase::Model::FundedOrganization, 'funded_organization', relationships['funded_organization'])
25
+
26
+ unless relationships['funded_organization'].nil?
27
+ if relationships['funded_organization']['item'].nil?
28
+
29
+ # Get organization's (investments - funding - organization)
30
+ instance_relationships_object(Crunchbase::Model::FundingRoundOrganization, 'funded_organization', relationships['funded_organization'])
31
+ else
32
+ # Get funding-rounds (funded_organization - item)
33
+
34
+ set_relationships_object(Crunchbase::Model::FundedOrganization, 'funded_organization', relationships['funded_organization'])
35
+ end
36
+ end
37
+
26
38
  set_relationships_object(Crunchbase::Model::Image, 'images', relationships['images'])
27
39
  set_relationships_object(Crunchbase::Model::Video, 'videos', relationships['videos'])
28
40
  set_relationships_object(Crunchbase::Model::New, 'news', relationships['news'])
@@ -0,0 +1,7 @@
1
+ # encoding: utf-8
2
+
3
+ module Crunchbase::Model
4
+ class FundingRoundOrganization < Crunchbase::Model::Organization
5
+
6
+ end
7
+ end
@@ -1,3 +1,3 @@
1
1
  module Crunchbase
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -0,0 +1,17 @@
1
+ require File.join(File.dirname(__FILE__), "../..", "spec_helper.rb")
2
+
3
+ module Crunchbase
4
+ module Model
5
+
6
+ describe Investment, "#organization_lists" do
7
+ begin
8
+ results = Investment.organization_lists("stripes-group").results
9
+ results.collect {|e| puts e.inspect }
10
+
11
+ rescue Exception => e
12
+ puts e.message
13
+ end
14
+ end
15
+
16
+ end
17
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crunchbase-ruby-library
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -111,6 +111,7 @@ files:
111
111
  - lib/crunchbase/model/fund_raise.rb
112
112
  - lib/crunchbase/model/funded_organization.rb
113
113
  - lib/crunchbase/model/funding_round.rb
114
+ - lib/crunchbase/model/funding_round_organization.rb
114
115
  - lib/crunchbase/model/headquarter.rb
115
116
  - lib/crunchbase/model/image.rb
116
117
  - lib/crunchbase/model/investment.rb
@@ -144,6 +145,7 @@ files:
144
145
  - spec/crunchbase/model/board_members_and_advisor_spec.rb
145
146
  - spec/crunchbase/model/fund_raise_spec.rb
146
147
  - spec/crunchbase/model/funding_round_spec.rb
148
+ - spec/crunchbase/model/investment_spec.rb
147
149
  - spec/crunchbase/model/office_spec.rb
148
150
  - spec/crunchbase/model/organization_spec.rb
149
151
  - spec/crunchbase/model/past_team_spec.rb
@@ -167,7 +169,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
167
169
  version: '0'
168
170
  segments:
169
171
  - 0
170
- hash: -3861617946174807121
172
+ hash: 3754659475277172758
171
173
  required_rubygems_version: !ruby/object:Gem::Requirement
172
174
  none: false
173
175
  requirements:
@@ -176,7 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
176
178
  version: '0'
177
179
  segments:
178
180
  - 0
179
- hash: -3861617946174807121
181
+ hash: 3754659475277172758
180
182
  requirements: []
181
183
  rubyforge_project:
182
184
  rubygems_version: 1.8.23.2
@@ -188,6 +190,7 @@ test_files:
188
190
  - spec/crunchbase/model/board_members_and_advisor_spec.rb
189
191
  - spec/crunchbase/model/fund_raise_spec.rb
190
192
  - spec/crunchbase/model/funding_round_spec.rb
193
+ - spec/crunchbase/model/investment_spec.rb
191
194
  - spec/crunchbase/model/office_spec.rb
192
195
  - spec/crunchbase/model/organization_spec.rb
193
196
  - spec/crunchbase/model/past_team_spec.rb