crunchbase_v2 0.0.2 → 0.0.3

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/README.rdoc CHANGED
@@ -40,7 +40,7 @@ Searching the Crunchbase is possible with the Search class, The Search will retu
40
40
  Get information by the permalink, Example:
41
41
 
42
42
  company = Crunchbase::Organization.get("facebook")
43
- Relationship objects [ competitors customers founders funding_rounds ipos products sub_organizations ]
43
+ Relationship objects [ competitors customers founders funding_rounds ipos products sub_organizations, acquisitions ]
44
44
  company.competitors Only return Top 8 items
45
45
  company.competitors_total_items Return competitors total items count
46
46
  company.competitors.each do |e|
@@ -48,7 +48,7 @@ Get information by the permalink, Example:
48
48
  puts competitor.name
49
49
  end
50
50
  OR
51
- Friendly relationship objects [ past_teams current_teams acquisitions offices headquarters categories investments primary_images images websites new_items board_members_and_advisors ]
51
+ Friendly relationship objects [ past_teams current_teams offices headquarters categories investments primary_images images websites new_items board_members_and_advisors ]
52
52
  company.websites
53
53
 
54
54
  If you want all competitors items, Please do:
@@ -39,12 +39,16 @@ module Crunchbase
39
39
  end
40
40
 
41
41
  def self.array_from_list(list)
42
+ return [] if list.nil?
43
+
42
44
  list['items'].map do |l|
43
45
  self.new l
44
46
  end
45
47
  end
46
48
 
47
49
  def self.total_items_from_list(list)
50
+ return 0 if list.nil?
51
+
48
52
  list['paging']['total_items']
49
53
  end
50
54
 
@@ -21,6 +21,11 @@ module Crunchbase
21
21
  @invested_in_type = json['invested_in_type'] && json['invested_in_type']['type']
22
22
  @invested_in_name = json['invested_in_type'] && json['invested_in_type']['name']
23
23
  @invested_in_path = json['invested_in_type'] && json['invested_in_type']['path']
24
+ elsif json['invested_in']
25
+ # From one's organization investments
26
+ @invested_in_type = json['invested_in'] && json['invested_in']['type']
27
+ @invested_in_name = json['invested_in'] && json['invested_in']['name']
28
+ @invested_in_path = json['invested_in'] && json['invested_in']['path']
24
29
  elsif json['investor']
25
30
  @invested_in_type = json['investor'] && json['investor']['type']
26
31
  @invested_in_name = json['investor'] && json['investor']['name']
@@ -17,10 +17,10 @@ module Crunchbase
17
17
 
18
18
 
19
19
  def initialize(json)
20
+ @type_name = json['type']
20
21
  properties = json['properties']
21
22
  relationships = json['relationships']
22
23
 
23
- @type_name = properties['type']
24
24
  @name = properties['name']
25
25
  @went_public_on = properties['went_public_on']
26
26
  @stock_symbol = properties['stock_symbol']
@@ -18,10 +18,10 @@ module Crunchbase
18
18
  :new_items_total_items
19
19
 
20
20
  def initialize(json)
21
+ @type_name = json['type']
21
22
  properties = json['properties']
22
23
  relationships = json['relationships']
23
24
 
24
- @type_name = properties['type']
25
25
  @name = properties['name']
26
26
  @lifecycle_stage = properties['lifecycle_stage']
27
27
  @owner_id = properties['owner_id']
@@ -1,11 +1,14 @@
1
1
  # encoding: utf-8
2
2
 
3
+ require 'date'
4
+
3
5
  module Crunchbase
4
6
  class Relationship < CBEntity
5
- attr_reader :name, :type_name, :path, :permalink, :created_at, :updated_at
7
+ attr_reader :name, :type_name, :path, :permalink, :created_at, :updated_at, :announced_on
6
8
 
7
9
  def initialize(hash)
8
10
  @type_name = hash["type"]
11
+ @announced_on = hash["announced_on"] && DateTime.parse(hash["announced_on"])
9
12
  @name = hash["name"]
10
13
  @path = hash["path"]
11
14
  @permalink = hash["path"].split('/').last
@@ -1,3 +1,3 @@
1
1
  module Crunchbase
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crunchbase_v2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: