crunchbase-ruby-library 0.0.1 → 0.0.2
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.
- data/lib/crunchbase/model/board_members_and_advisor.rb +4 -5
- data/lib/crunchbase/model/current_team.rb +4 -5
- data/lib/crunchbase/model/entity.rb +1 -1
- data/lib/crunchbase/model/investor.rb +2 -6
- data/lib/crunchbase/model/job.rb +2 -8
- data/lib/crunchbase/model/membership.rb +2 -6
- data/lib/crunchbase/model/past_team.rb +4 -5
- data/lib/crunchbase/model/search.rb +1 -0
- data/lib/crunchbase/version.rb +1 -1
- data/spec/crunchbase/model/past_team_spec.rb +1 -1
- metadata +4 -4
@@ -11,14 +11,13 @@ module Crunchbase::Model
|
|
11
11
|
super
|
12
12
|
|
13
13
|
unless (relationships = json['relationships']).nil?
|
14
|
-
|
14
|
+
instance_relationships_object(Crunchbase::Model::Person, 'person', relationships['person'])
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
instance_variable_set "@#{key}", ( object_name.new(item) || nil )
|
18
|
+
# Factory method to return an instance from a permalink
|
19
|
+
def self.get(permalink)
|
20
|
+
nil
|
22
21
|
end
|
23
22
|
|
24
23
|
end
|
@@ -11,14 +11,13 @@ module Crunchbase::Model
|
|
11
11
|
super
|
12
12
|
|
13
13
|
unless (relationships = json['relationships']).nil?
|
14
|
-
|
14
|
+
instance_relationships_object(Crunchbase::Model::Person, 'person', relationships['person'])
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
instance_variable_set "@#{key}", ( object_name.new(item) || nil )
|
18
|
+
# Factory method to return an instance from a permalink
|
19
|
+
def self.get(permalink)
|
20
|
+
nil
|
22
21
|
end
|
23
22
|
|
24
23
|
end
|
@@ -8,12 +8,8 @@ module Crunchbase::Model
|
|
8
8
|
attr_reader :object
|
9
9
|
|
10
10
|
def initialize(json)
|
11
|
-
|
12
|
-
|
13
|
-
end
|
14
|
-
|
15
|
-
def set_relationship_object(key, object_name, json)
|
16
|
-
instance_variable_set "@#{key}", ( object_name.new(json) || nil )
|
11
|
+
instance_relationships_object(Crunchbase::Model::Person, 'object', json) if json['type'] == 'Person'
|
12
|
+
instance_relationships_object(Crunchbase::Model::Organization, 'object', json) if json['type'] == 'Organization'
|
17
13
|
end
|
18
14
|
|
19
15
|
def person?
|
data/lib/crunchbase/model/job.rb
CHANGED
@@ -14,8 +14,8 @@ module Crunchbase::Model
|
|
14
14
|
super
|
15
15
|
|
16
16
|
unless (relationships = json['relationships']).nil?
|
17
|
-
|
18
|
-
|
17
|
+
instance_relationships_object(Crunchbase::Model::Person, 'person', relationships['person'])
|
18
|
+
instance_relationships_object(Crunchbase::Model::Organization, 'organization', relationships['organization'])
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
@@ -29,11 +29,5 @@ module Crunchbase::Model
|
|
29
29
|
%w[ started_on ended_on ]
|
30
30
|
end
|
31
31
|
|
32
|
-
def set_relationships_object(object_name, key, item)
|
33
|
-
return unless item
|
34
|
-
|
35
|
-
instance_variable_set "@#{key}", ( object_name.new(item) || nil )
|
36
|
-
end
|
37
|
-
|
38
32
|
end
|
39
33
|
end
|
@@ -8,12 +8,8 @@ module Crunchbase::Model
|
|
8
8
|
attr_reader :object
|
9
9
|
|
10
10
|
def initialize(json)
|
11
|
-
|
12
|
-
|
13
|
-
end
|
14
|
-
|
15
|
-
def set_relationship_object(key, object_name, json)
|
16
|
-
instance_variable_set "@#{key}", ( object_name.new(json) || nil )
|
11
|
+
instance_relationships_object(Crunchbase::Model::Person, 'object', json) if json['type'] == 'Person'
|
12
|
+
instance_relationships_object(Crunchbase::Model::Organization, 'object', json) if json['type'] == 'Organization'
|
17
13
|
end
|
18
14
|
|
19
15
|
def person?
|
@@ -11,14 +11,13 @@ module Crunchbase::Model
|
|
11
11
|
super
|
12
12
|
|
13
13
|
unless (relationships = json['relationships']).nil?
|
14
|
-
|
14
|
+
instance_relationships_object(Crunchbase::Model::Person, 'person', relationships['person'])
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
instance_variable_set "@#{key}", ( object_name.new(item) || nil )
|
18
|
+
# Factory method to return an instance from a permalink
|
19
|
+
def self.get(permalink)
|
20
|
+
nil
|
22
21
|
end
|
23
22
|
|
24
23
|
end
|
data/lib/crunchbase/version.rb
CHANGED
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.
|
4
|
+
version: 0.0.2
|
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-
|
12
|
+
date: 2015-05-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -163,7 +163,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
163
163
|
version: '0'
|
164
164
|
segments:
|
165
165
|
- 0
|
166
|
-
hash:
|
166
|
+
hash: -1555948034410529507
|
167
167
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
168
168
|
none: false
|
169
169
|
requirements:
|
@@ -172,7 +172,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
172
172
|
version: '0'
|
173
173
|
segments:
|
174
174
|
- 0
|
175
|
-
hash:
|
175
|
+
hash: -1555948034410529507
|
176
176
|
requirements: []
|
177
177
|
rubyforge_project:
|
178
178
|
rubygems_version: 1.8.23.2
|