crunchbase-ruby-library 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.
@@ -1,7 +1,29 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Crunchbase::Model
4
- class AcquiredBy < Crunchbase::Model::Acquisition
4
+ class AcquiredBy < Crunchbase::Model::Entity
5
+
5
6
  RESOURCE_LIST = 'acquired_by'
7
+
8
+ attr_reader :announced_on, :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[ announced_on name path created_at updated_at ]
22
+ end
23
+
24
+ def date_keys
25
+ %w[ announced_on ]
26
+ end
27
+
6
28
  end
7
29
  end
@@ -37,8 +37,6 @@ module Crunchbase::Model
37
37
  set_relationships_object(Crunchbase::Model::PrimaryImage, 'primary_image', relationships['primary_image'])
38
38
  set_relationships_object(Crunchbase::Model::Founder, 'founders', relationships['founders'])
39
39
  set_relationships_object(Crunchbase::Model::CurrentTeam, 'current_team', relationships['current_team'])
40
- set_relationships_object(Crunchbase::Model::PastTeam, 'past_team', relationships['past_team'])
41
- # set_relationships_object(PrimaryImage, 'board_members_and_advisors', relationships['board_members_and_advisors'])
42
40
  set_relationships_object(Crunchbase::Model::Investor, 'investors', relationships['investors'])
43
41
  set_relationships_object(Crunchbase::Model::OwnedBy, 'owned_by', relationships['owned_by'])
44
42
  set_relationships_object(Crunchbase::Model::SubOrganization, 'sub_organizations', relationships['sub_organizations'])
@@ -1,3 +1,3 @@
1
1
  module Crunchbase
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -6,31 +6,31 @@ module Crunchbase
6
6
  describe Organization do
7
7
 
8
8
  before(:all) do
9
- @organization = Organization.get("facebook")
9
+ @organization = Organization.get("abovenet")
10
10
  end
11
11
 
12
12
  it 'show all products name' do
13
- puts @organization.products.map { |i| i.name }.inspect
13
+ puts @organization.products.map { |i| i.name }.inspect unless @organization.products.nil?
14
14
  end
15
15
 
16
16
  it 'show all offices name' do
17
- puts @organization.offices.map { |i| i.name }.inspect
17
+ puts @organization.offices.map { |i| i.name }.inspect unless @organization.offices.nil?
18
18
  end
19
19
 
20
20
  it 'show all funding_rounds funding_type' do
21
- puts @organization.funding_rounds.map { |i| i.funding_type }.inspect
21
+ puts @organization.funding_rounds.map { |i| i.funding_type }.inspect unless @organization.funding_rounds.nil?
22
22
  end
23
23
 
24
24
  it 'show all competitors name' do
25
- puts @organization.competitors.map { |i| i.name }.inspect
25
+ puts @organization.competitors.map { |i| i.name }.inspect unless @organization.competitors.nil?
26
26
  end
27
27
 
28
28
  it 'show all investments money_invested' do
29
- puts @organization.investments.map { |i| i.money_invested }.inspect
29
+ puts @organization.investments.map { |i| i.money_invested }.inspect unless @organization.investments.nil?
30
30
  end
31
31
 
32
32
  it 'show all acquisitions acquiree name' do
33
- puts @organization.acquisitions.map { |i| i.acquiree.name }.inspect
33
+ puts @organization.acquisitions.map { |i| i.acquiree.name }.inspect unless @organization.acquisitions.nil?
34
34
  end
35
35
 
36
36
  it 'show all ipo funded_company name' do
@@ -39,19 +39,19 @@ module Crunchbase
39
39
  end
40
40
 
41
41
  it "show all categories name" do
42
- puts @organization.categories.map {|i| i.name }.inspect
42
+ puts @organization.categories.map {|i| i.name }.inspect unless @organization.categories.nil?
43
43
  end
44
44
 
45
45
  it "show all news name" do
46
- puts @organization.news.map {|i| i.title }.inspect
46
+ puts @organization.news.map {|i| i.title }.inspect unless @organization.news.nil?
47
47
  end
48
48
 
49
49
  it "show all current_team members name" do
50
- puts @organization.current_team.map {|i| [i.title, i.person.last_name] }.inspect
50
+ puts @organization.current_team.map {|i| [i.title, i.person.last_name] }.inspect unless @organization.current_team.nil?
51
51
  end
52
52
 
53
53
  it "show all websites website" do
54
- puts @organization.websites.map {|i| i.website }.inspect
54
+ puts @organization.websites.map {|i| i.website }.inspect unless @organization.websites.nil?
55
55
  end
56
56
 
57
57
  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.3
4
+ version: 0.0.4
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-27 00:00:00.000000000 Z
12
+ date: 2015-05-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -165,7 +165,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
165
165
  version: '0'
166
166
  segments:
167
167
  - 0
168
- hash: 3314474323939257372
168
+ hash: -4172991570968200579
169
169
  required_rubygems_version: !ruby/object:Gem::Requirement
170
170
  none: false
171
171
  requirements:
@@ -174,7 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
174
174
  version: '0'
175
175
  segments:
176
176
  - 0
177
- hash: 3314474323939257372
177
+ hash: -4172991570968200579
178
178
  requirements: []
179
179
  rubyforge_project:
180
180
  rubygems_version: 1.8.23.2