crunchbase-ruby-library 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -17,6 +17,7 @@ module Crunchbase
17
17
  autoload :FoundedCompany, "crunchbase/model/founded_company"
18
18
  autoload :Founder, "crunchbase/model/founder"
19
19
  autoload :Fund, "crunchbase/model/fund"
20
+ autoload :FundRaise, "crunchbase/model/fund_raise"
20
21
  autoload :FundedOrganization, "crunchbase/model/funded_organization"
21
22
  autoload :FundingRound, "crunchbase/model/funding_round"
22
23
  autoload :Headquarter, "crunchbase/model/headquarter"
@@ -0,0 +1,25 @@
1
+ # encoding utf-8
2
+
3
+ module Crunchbase::Model
4
+ class FundRaise < Crunchbase::Model::Entity
5
+
6
+ RESOURCE_LIST = 'funds'
7
+
8
+ attr_reader :name, :path, :created_at, :updated_at
9
+
10
+ def initialize(json)
11
+ property_keys.each { |v|
12
+ instance_variable_set("@#{v}", json[v] || nil)
13
+ }
14
+
15
+ %w[created_at updated_at].each { |v|
16
+ instance_variable_set("@#{v}", Time.at(json[v]))
17
+ }
18
+ end
19
+
20
+ def property_keys
21
+ %w[ name path created_at updated_at ]
22
+ end
23
+
24
+ end
25
+ end
@@ -46,14 +46,13 @@ module Crunchbase::Model
46
46
  set_relationships_object(Crunchbase::Model::Category, 'categories', relationships['categories'])
47
47
  set_relationships_object(Crunchbase::Model::Customer, 'customers', relationships['customers'])
48
48
  set_relationships_object(Crunchbase::Model::Competitor, 'competitors', relationships['competitors'])
49
- # set_relationships_object(PrimaryImage, 'members', relationships['members'])
50
49
  set_relationships_object(Crunchbase::Model::Membership, 'memberships', relationships['memberships'])
51
50
  set_relationships_object(Crunchbase::Model::FundingRound, 'funding_rounds', relationships['funding_rounds'])
52
51
  set_relationships_object(Crunchbase::Model::Investment, 'investments', relationships['investments'])
53
52
  set_relationships_object(Crunchbase::Model::Acquisition, 'acquisitions', relationships['acquisitions'])
54
53
  set_relationships_object(Crunchbase::Model::AcquiredBy, 'acquired_by', relationships['acquired_by'])
55
54
  set_relationships_object(Crunchbase::Model::Ipo, 'ipo', relationships['ipo'])
56
- set_relationships_object(Crunchbase::Model::Fund, 'funds', relationships['funds'])
55
+ set_relationships_object(Crunchbase::Model::FundRaise, 'funds', relationships['funds'])
57
56
  set_relationships_object(Crunchbase::Model::Website, 'websites', relationships['websites'])
58
57
  set_relationships_object(Crunchbase::Model::Image, 'images', relationships['images'])
59
58
  set_relationships_object(Crunchbase::Model::Video, 'videos', relationships['videos'])
@@ -1,3 +1,3 @@
1
1
  module Crunchbase
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -0,0 +1,26 @@
1
+ require File.join(File.dirname(__FILE__), "../..", "spec_helper.rb")
2
+
3
+ module Crunchbase
4
+ module Model
5
+
6
+ describe FundRaise do
7
+
8
+ before(:all) do
9
+ begin
10
+ @funds = FundRaise.organization_lists("apple")
11
+ rescue Exception => e
12
+ @funds = nil
13
+ end
14
+ end
15
+
16
+ it 'show funds results' do
17
+ unless @funds.nil?
18
+ puts @funds.total_items
19
+
20
+ puts @funds.results.collect { |p| [p.name] }.inspect
21
+ end
22
+ end
23
+
24
+ end
25
+ end
26
+ 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.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-05-28 00:00:00.000000000 Z
12
+ date: 2015-06-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -108,6 +108,7 @@ files:
108
108
  - lib/crunchbase/model/founded_company.rb
109
109
  - lib/crunchbase/model/founder.rb
110
110
  - lib/crunchbase/model/fund.rb
111
+ - lib/crunchbase/model/fund_raise.rb
111
112
  - lib/crunchbase/model/funded_organization.rb
112
113
  - lib/crunchbase/model/funding_round.rb
113
114
  - lib/crunchbase/model/headquarter.rb
@@ -141,6 +142,7 @@ files:
141
142
  - lib/crunchbase/version.rb
142
143
  - spec/crunchbase.yml.example
143
144
  - spec/crunchbase/model/board_members_and_advisor_spec.rb
145
+ - spec/crunchbase/model/fund_raise_spec.rb
144
146
  - spec/crunchbase/model/funding_round_spec.rb
145
147
  - spec/crunchbase/model/office_spec.rb
146
148
  - spec/crunchbase/model/organization_spec.rb
@@ -165,7 +167,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
165
167
  version: '0'
166
168
  segments:
167
169
  - 0
168
- hash: -3202684479065248620
170
+ hash: -3861617946174807121
169
171
  required_rubygems_version: !ruby/object:Gem::Requirement
170
172
  none: false
171
173
  requirements:
@@ -174,7 +176,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
174
176
  version: '0'
175
177
  segments:
176
178
  - 0
177
- hash: -3202684479065248620
179
+ hash: -3861617946174807121
178
180
  requirements: []
179
181
  rubyforge_project:
180
182
  rubygems_version: 1.8.23.2
@@ -184,6 +186,7 @@ summary: Ruby wrapper for Crunchbase API version 3
184
186
  test_files:
185
187
  - spec/crunchbase.yml.example
186
188
  - spec/crunchbase/model/board_members_and_advisor_spec.rb
189
+ - spec/crunchbase/model/fund_raise_spec.rb
187
190
  - spec/crunchbase/model/funding_round_spec.rb
188
191
  - spec/crunchbase/model/office_spec.rb
189
192
  - spec/crunchbase/model/organization_spec.rb