crunchbase-ruby-library 0.1.7 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +66 -0
  3. data/.rubocop_todo.yml +47 -0
  4. data/.travis.yml +12 -0
  5. data/Gemfile +4 -0
  6. data/README.md +44 -54
  7. data/Rakefile +4 -1
  8. data/bin/console +15 -0
  9. data/bin/setup +8 -0
  10. data/crunchbase-ruby-library.gemspec +15 -12
  11. data/lib/crunchbase.rb +12 -3
  12. data/lib/crunchbase/api.rb +110 -102
  13. data/lib/crunchbase/client.rb +50 -0
  14. data/lib/crunchbase/exception.rb +13 -11
  15. data/lib/crunchbase/model.rb +50 -48
  16. data/lib/crunchbase/model/acquired_by.rb +23 -20
  17. data/lib/crunchbase/model/acquiree.rb +2 -1
  18. data/lib/crunchbase/model/acquirer.rb +2 -1
  19. data/lib/crunchbase/model/acquisition.rb +16 -19
  20. data/lib/crunchbase/model/address.rb +4 -6
  21. data/lib/crunchbase/model/advisory_role.rb +2 -2
  22. data/lib/crunchbase/model/board_members_and_advisor.rb +10 -9
  23. data/lib/crunchbase/model/category.rb +6 -7
  24. data/lib/crunchbase/model/competitor.rb +3 -2
  25. data/lib/crunchbase/model/current_team.rb +7 -11
  26. data/lib/crunchbase/model/customer.rb +3 -2
  27. data/lib/crunchbase/model/degree.rb +4 -5
  28. data/lib/crunchbase/model/entity.rb +98 -108
  29. data/lib/crunchbase/model/error.rb +3 -4
  30. data/lib/crunchbase/model/featured_team.rb +19 -0
  31. data/lib/crunchbase/model/founded_company.rb +2 -3
  32. data/lib/crunchbase/model/founder.rb +3 -4
  33. data/lib/crunchbase/model/fund.rb +8 -11
  34. data/lib/crunchbase/model/fund_raise.rb +7 -8
  35. data/lib/crunchbase/model/funding_round.rb +29 -24
  36. data/lib/crunchbase/model/headquarter.rb +2 -1
  37. data/lib/crunchbase/model/image.rb +6 -7
  38. data/lib/crunchbase/model/investment.rb +20 -27
  39. data/lib/crunchbase/model/investor.rb +6 -7
  40. data/lib/crunchbase/model/ipo.rb +12 -12
  41. data/lib/crunchbase/model/job.rb +11 -10
  42. data/lib/crunchbase/model/location.rb +20 -11
  43. data/lib/crunchbase/model/member.rb +3 -4
  44. data/lib/crunchbase/model/membership.rb +7 -8
  45. data/lib/crunchbase/model/new.rb +5 -6
  46. data/lib/crunchbase/model/office.rb +3 -4
  47. data/lib/crunchbase/model/organization.rb +39 -38
  48. data/lib/crunchbase/model/organization_summary.rb +7 -8
  49. data/lib/crunchbase/model/owned_by.rb +4 -5
  50. data/lib/crunchbase/model/parent_location.rb +3 -3
  51. data/lib/crunchbase/model/past_team.rb +7 -11
  52. data/lib/crunchbase/model/person.rb +53 -46
  53. data/lib/crunchbase/model/person_summary.rb +13 -14
  54. data/lib/crunchbase/model/primary_affiliation.rb +6 -6
  55. data/lib/crunchbase/model/primary_image.rb +3 -3
  56. data/lib/crunchbase/model/primary_location.rb +8 -7
  57. data/lib/crunchbase/model/product.rb +14 -13
  58. data/lib/crunchbase/model/product_summary.rb +4 -5
  59. data/lib/crunchbase/model/school.rb +3 -2
  60. data/lib/crunchbase/model/search.rb +39 -40
  61. data/lib/crunchbase/model/search_result.rb +7 -6
  62. data/lib/crunchbase/model/simple_organization.rb +9 -10
  63. data/lib/crunchbase/model/sub_organization.rb +3 -4
  64. data/lib/crunchbase/model/video.rb +4 -5
  65. data/lib/crunchbase/model/website.rb +7 -11
  66. data/lib/crunchbase/request.rb +8 -0
  67. data/lib/crunchbase/request/client.rb +69 -0
  68. data/lib/crunchbase/version.rb +2 -1
  69. data/spec/crunchbase.yml.example +2 -2
  70. data/spec/crunchbase/client_spec.rb +25 -0
  71. data/spec/crunchbase/data/board_members_and_advisors/facebook.json +462 -0
  72. data/spec/crunchbase/data/categories/facebook.json +67 -0
  73. data/spec/crunchbase/data/current_team/facebook.json +4335 -0
  74. data/spec/crunchbase/data/featured_team/facebook.json +286 -0
  75. data/spec/crunchbase/data/funding_rounds/37bd05f961af726ba3c1b279da842805.json +484 -0
  76. data/spec/crunchbase/data/funding_rounds/facebook.json +2049 -0
  77. data/spec/crunchbase/data/headquarters/facebook.json +50 -0
  78. data/spec/crunchbase/data/investors/facebook.json +776 -0
  79. data/spec/crunchbase/data/news/facebook.json +1426 -0
  80. data/spec/crunchbase/data/news/facebook_2.json +1426 -0
  81. data/spec/crunchbase/data/offices/facebook.json +50 -0
  82. data/spec/crunchbase/data/organizations/crunchbase.json +2845 -0
  83. data/spec/crunchbase/data/organizations/ekohe.json +654 -0
  84. data/spec/crunchbase/data/organizations/facebook-without-relationships.json +45 -0
  85. data/spec/crunchbase/data/organizations/facebook.json +6723 -0
  86. data/spec/crunchbase/data/organizations/mx-media-llc.json +7 -0
  87. data/spec/crunchbase/data/past_team/facebook.json +4336 -0
  88. data/spec/crunchbase/data/people/facebook_founders.json +148 -0
  89. data/spec/crunchbase/data/people/mark-zuckerberg.json +2602 -0
  90. data/spec/crunchbase/data/websites/facebook.json +74 -0
  91. data/spec/crunchbase/model/board_members_and_advisor_spec.rb +39 -11
  92. data/spec/crunchbase/model/category_spec.rb +47 -0
  93. data/spec/crunchbase/model/current_team_spec.rb +50 -0
  94. data/spec/crunchbase/model/featured_team_spec.rb +40 -0
  95. data/spec/crunchbase/model/founders_spec.rb +49 -0
  96. data/spec/crunchbase/model/fund_raise_spec.rb +4 -24
  97. data/spec/crunchbase/model/funding_round_spec.rb +75 -32
  98. data/spec/crunchbase/model/headquarter_spec.rb +37 -0
  99. data/spec/crunchbase/model/investment_spec.rb +4 -15
  100. data/spec/crunchbase/model/investor_spec.rb +37 -0
  101. data/spec/crunchbase/model/new_spec.rb +86 -0
  102. data/spec/crunchbase/model/office_spec.rb +29 -9
  103. data/spec/crunchbase/model/organization_spec.rb +160 -34
  104. data/spec/crunchbase/model/past_team_spec.rb +36 -14
  105. data/spec/crunchbase/model/person_spec.rb +21 -19
  106. data/spec/crunchbase/model/product_spec.rb +4 -31
  107. data/spec/crunchbase/model/search_spec.rb +25 -49
  108. data/spec/crunchbase/model/website_spec.rb +36 -9
  109. data/spec/crunchbase/support/api_helper.rb +19 -0
  110. data/spec/spec_helper.rb +14 -4
  111. metadata +103 -6
@@ -0,0 +1,50 @@
1
+ # encoding: utf-8
2
+ # frozen_string_literal: true
3
+
4
+ module Crunchbase
5
+ class Client
6
+ # Get information by permalink with optional one relationship
7
+ def get(permalink, kclass_name, relationship_name = nil)
8
+ case kclass_name
9
+ when 'Person'
10
+ person(permalink, relationship_name)
11
+ when 'Organization'
12
+ organization(permalink, relationship_name)
13
+ end
14
+ end
15
+
16
+ # Get organization information by the permalink
17
+ def organization(permalink, kclass_name = nil)
18
+ request_perform('Organization', permalink, kclass_name)
19
+ end
20
+
21
+ # Get person information by the permalink
22
+ def person(permalink, kclass_name = nil)
23
+ request_perform('Person', permalink, kclass_name)
24
+ end
25
+
26
+ def list(kclass_name, options = {})
27
+ page = options[:page] || 1
28
+
29
+ kclass(kclass_name).list(page)
30
+ end
31
+
32
+ # options -> { query: "Ekohe" } || { name: "Ekohe" } || { domain_name: "ekohe.com" }
33
+ def search(options, kclass_name)
34
+ return [] if kclass_name.nil?
35
+
36
+ kclass('Search').search(options, kclass_name)
37
+ end
38
+
39
+ def request_perform(stand_kclass, permalink, kclass_name)
40
+ return kclass(stand_kclass).get(permalink) if kclass_name.nil?
41
+
42
+ kclass(kclass_name).organization_lists(permalink)
43
+ end
44
+
45
+ private
46
+ def kclass(kclass_name)
47
+ Crunchbase::Model.const_get kclass_name
48
+ end
49
+ end
50
+ end
@@ -1,18 +1,20 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  module Crunchbase
4
- class Exception < ::Exception
5
- end
6
-
7
- class ConfigurationException < Exception
8
- end
5
+ class Exception < RuntimeError; end
6
+ class ConfigurationException < RuntimeError; end
7
+ class MissingParamsException < RuntimeError; end
8
+ class InvalidRequestException < RuntimeError; end
9
+ class ResponseTypeException < RuntimeError; end
10
+ class CertificateError < StandardError; end
9
11
 
10
- class MissingParamsException < Exception
11
- end
12
-
13
- class InvalidRequestException < Exception
14
- end
12
+ class ResponseError < StandardError
13
+ attr_reader :response
15
14
 
16
- class ResponseTypeException < Exception
15
+ def initialize(message, response)
16
+ @response = response
17
+ super(message)
18
+ end
17
19
  end
18
20
  end
@@ -1,54 +1,56 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  module Crunchbase
4
5
  module Model
5
- autoload :AcquiredBy, "crunchbase/model/acquired_by"
6
- autoload :Acquiree, "crunchbase/model/acquiree"
7
- autoload :Acquirer, "crunchbase/model/acquirer"
8
- autoload :Acquisition, "crunchbase/model/acquisition"
9
- autoload :Address, "crunchbase/model/address"
10
- autoload :AdvisoryRole, "crunchbase/model/advisory_role"
11
- autoload :BoardMembersAndAdvisor, "crunchbase/model/board_members_and_advisor"
12
- autoload :Category, "crunchbase/model/category"
13
- autoload :Competitor, "crunchbase/model/competitor"
14
- autoload :CurrentTeam, "crunchbase/model/current_team"
15
- autoload :Customer, "crunchbase/model/customer"
16
- autoload :Degree, "crunchbase/model/degree"
17
- autoload :Error, "crunchbase/model/error"
18
- autoload :Entity, "crunchbase/model/entity"
19
- autoload :FoundedCompany, "crunchbase/model/founded_company"
20
- autoload :Founder, "crunchbase/model/founder"
21
- autoload :Fund, "crunchbase/model/fund"
22
- autoload :FundRaise, "crunchbase/model/fund_raise"
23
- autoload :FundingRound, "crunchbase/model/funding_round"
24
- autoload :Headquarter, "crunchbase/model/headquarter"
25
- autoload :Image, "crunchbase/model/image"
26
- autoload :Investment, "crunchbase/model/investment"
27
- autoload :Investor, "crunchbase/model/investor"
28
- autoload :Ipo, "crunchbase/model/ipo"
29
- autoload :Job, "crunchbase/model/job"
30
- autoload :Location, "crunchbase/model/location"
31
- autoload :Member, "crunchbase/model/member"
32
- autoload :Membership, "crunchbase/model/membership"
33
- autoload :New, "crunchbase/model/new"
34
- autoload :Office, "crunchbase/model/office"
35
- autoload :Organization, "crunchbase/model/organization"
36
- autoload :OrganizationSummary, "crunchbase/model/organization_summary"
37
- autoload :OwnedBy, "crunchbase/model/owned_by"
38
- autoload :PastTeam, "crunchbase/model/past_team"
39
- autoload :Person, "crunchbase/model/person"
40
- autoload :PersonSummary, "crunchbase/model/person_summary"
41
- autoload :PrimaryAffiliation, "crunchbase/model/primary_affiliation"
42
- autoload :PrimaryImage, "crunchbase/model/primary_image"
43
- autoload :PrimaryLocation, "crunchbase/model/primary_location"
44
- autoload :Product, "crunchbase/model/product"
45
- autoload :ProductSummary, "crunchbase/model/product_summary"
46
- autoload :School, "crunchbase/model/school"
47
- autoload :Search, "crunchbase/model/search"
48
- autoload :SearchResult, "crunchbase/model/search_result"
49
- autoload :SimpleOrganization, "crunchbase/model/simple_organization"
50
- autoload :SubOrganization, "crunchbase/model/sub_organization"
51
- autoload :Video, "crunchbase/model/video"
52
- autoload :Website, "crunchbase/model/website"
6
+ autoload :AcquiredBy, 'crunchbase/model/acquired_by'
7
+ autoload :Acquiree, 'crunchbase/model/acquiree'
8
+ autoload :Acquirer, 'crunchbase/model/acquirer'
9
+ autoload :Acquisition, 'crunchbase/model/acquisition'
10
+ autoload :Address, 'crunchbase/model/address'
11
+ autoload :AdvisoryRole, 'crunchbase/model/advisory_role'
12
+ autoload :BoardMembersAndAdvisor, 'crunchbase/model/board_members_and_advisor'
13
+ autoload :Category, 'crunchbase/model/category'
14
+ autoload :Competitor, 'crunchbase/model/competitor'
15
+ autoload :FeaturedTeam, 'crunchbase/model/featured_team'
16
+ autoload :CurrentTeam, 'crunchbase/model/current_team'
17
+ autoload :Customer, 'crunchbase/model/customer'
18
+ autoload :Degree, 'crunchbase/model/degree'
19
+ autoload :Error, 'crunchbase/model/error'
20
+ autoload :Entity, 'crunchbase/model/entity'
21
+ autoload :FoundedCompany, 'crunchbase/model/founded_company'
22
+ autoload :Founder, 'crunchbase/model/founder'
23
+ autoload :Fund, 'crunchbase/model/fund'
24
+ autoload :FundRaise, 'crunchbase/model/fund_raise'
25
+ autoload :FundingRound, 'crunchbase/model/funding_round'
26
+ autoload :Headquarter, 'crunchbase/model/headquarter'
27
+ autoload :Image, 'crunchbase/model/image'
28
+ autoload :Investment, 'crunchbase/model/investment'
29
+ autoload :Investor, 'crunchbase/model/investor'
30
+ autoload :Ipo, 'crunchbase/model/ipo'
31
+ autoload :Job, 'crunchbase/model/job'
32
+ autoload :Location, 'crunchbase/model/location'
33
+ autoload :Member, 'crunchbase/model/member'
34
+ autoload :Membership, 'crunchbase/model/membership'
35
+ autoload :New, 'crunchbase/model/new'
36
+ autoload :Office, 'crunchbase/model/office'
37
+ autoload :Organization, 'crunchbase/model/organization'
38
+ autoload :OrganizationSummary, 'crunchbase/model/organization_summary'
39
+ autoload :OwnedBy, 'crunchbase/model/owned_by'
40
+ autoload :PastTeam, 'crunchbase/model/past_team'
41
+ autoload :Person, 'crunchbase/model/person'
42
+ autoload :PersonSummary, 'crunchbase/model/person_summary'
43
+ autoload :PrimaryAffiliation, 'crunchbase/model/primary_affiliation'
44
+ autoload :PrimaryImage, 'crunchbase/model/primary_image'
45
+ autoload :PrimaryLocation, 'crunchbase/model/primary_location'
46
+ autoload :Product, 'crunchbase/model/product'
47
+ autoload :ProductSummary, 'crunchbase/model/product_summary'
48
+ autoload :School, 'crunchbase/model/school'
49
+ autoload :Search, 'crunchbase/model/search'
50
+ autoload :SearchResult, 'crunchbase/model/search_result'
51
+ autoload :SimpleOrganization, 'crunchbase/model/simple_organization'
52
+ autoload :SubOrganization, 'crunchbase/model/sub_organization'
53
+ autoload :Video, 'crunchbase/model/video'
54
+ autoload :Website, 'crunchbase/model/website'
53
55
  end
54
56
  end
@@ -1,31 +1,34 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
- module Crunchbase::Model
4
- class AcquiredBy < Crunchbase::Model::Entity
4
+ module Crunchbase
5
+ module Model
6
+ class AcquiredBy < Entity
7
+ RESOURCE_LIST = 'acquired_by'
5
8
 
6
- RESOURCE_LIST = 'acquired_by'
9
+ attr_reader :uuid, :type_name, :api_path, :web_path, :price, :price_currency_code, :price_usd,
10
+ :payment_type, :acquisition_type, :acquisition_status, :disposition_of_acquired,
11
+ :announced_on, :announced_on_trust_code, :completed_on, :completed_on_trust_code,
12
+ :acquiree, :acquirer, :created_at, :updated_at
7
13
 
8
- attr_reader :uuid, :type_name
9
- attr_reader :api_path, :web_path, :price, :price_currency_code, :price_usd, :payment_type, :acquisition_type, :acquisition_status, :disposition_of_acquired, :announced_on, :announced_on_trust_code, :completed_on, :completed_on_trust_code, :created_at, :updated_at
10
-
11
- attr_reader :acquiree, :acquirer
12
-
13
- def initialize(json)
14
- super
14
+ def initialize(json)
15
+ super(json)
16
+ end
15
17
 
16
- unless (relationships = json['relationships']).nil?
17
- instance_relationships_object(Crunchbase::Model::Organization, 'aquiree', relationships['acquiree'])
18
- instance_relationships_object(Crunchbase::Model::Organization, 'acquirer', relationships['acquirer'])
18
+ def relationship_lists
19
+ {
20
+ 'aquiree' => Organization,
21
+ 'acquirer' => Organization
22
+ }
19
23
  end
20
- end
21
24
 
22
- def property_keys
23
- %w[ api_path web_path price price_currency_code price_usd payment_type acquisition_type acquisition_status disposition_of_acquired announced_on announced_on_trust_code completed_on completed_on_trust_code created_at updated_at ]
24
- end
25
+ def property_keys
26
+ %w(api_path web_path price price_currency_code price_usd payment_type acquisition_type acquisition_status disposition_of_acquired announced_on announced_on_trust_code completed_on completed_on_trust_code created_at updated_at)
27
+ end
25
28
 
26
- def date_keys
27
- %w[ announced_on completed_on ]
29
+ def date_keys
30
+ %w(announced_on completed_on)
31
+ end
28
32
  end
29
-
30
33
  end
31
34
  end
@@ -1,6 +1,7 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  module Crunchbase::Model
4
- class Acquiree < Crunchbase::Model::SimpleOrganization
5
+ class Acquiree < Organization
5
6
  end
6
7
  end
@@ -1,6 +1,7 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  module Crunchbase::Model
4
- class Acquirer < Crunchbase::Model::SimpleOrganization
5
+ class Acquirer < Organization
5
6
  end
6
7
  end
@@ -1,47 +1,44 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  module Crunchbase::Model
4
- class Acquisition < Crunchbase::Model::Entity
5
-
5
+ class Acquisition < Entity
6
6
  RESOURCE_LIST = 'acquisitions'
7
7
  RESOURCE_NAME = 'acquisitions'
8
8
 
9
9
  attr_reader :api_path, :web_path, :price, :price_currency_code, :price_usd,
10
10
  :payment_type, :acquisition_type, :acquisition_status, :disposition_of_acquired,
11
11
  :announced_on, :announced_on_trust_code, :completed_on, :completed_on_trust_code,
12
+ :acquirer, :acquiree, :news,
13
+ :acquirer_total_items, :acquiree_total_items, :news_items,
12
14
  :created_at, :updated_at
13
15
 
14
-
15
- attr_reader :acquirer, :acquiree, :news
16
-
17
- attr_reader :acquirer_total_items, :acquiree_total_items, :news_items
18
-
19
16
  def initialize(json)
20
17
  super
21
18
 
22
- unless (relationships = json['relationships']).nil?
23
- if relationships['acquiree']['item'].nil?
24
- instance_relationships_object(Crunchbase::Model::Organization, 'acquiree', relationships['acquiree'])
25
- else
26
- set_relationships_object(Crunchbase::Model::Acquiree, 'acquiree', relationships['acquiree'])
27
- set_relationships_object(Crunchbase::Model::Acquirer, 'acquirer', relationships['acquirer'])
28
- set_relationships_object(Crunchbase::Model::New, 'news', relationships['news'])
29
- end
19
+ relationships = json['relationships']
20
+ return if relationships.nil?
21
+
22
+ if relationships['acquiree']['item'].nil?
23
+ instance_relationships_object(Organization, 'acquiree', relationships['acquiree'])
24
+ else
25
+ set_relationships_object(Acquiree, 'acquiree', relationships['acquiree'])
26
+ set_relationships_object(Acquirer, 'acquirer', relationships['acquirer'])
27
+ set_relationships_object(New, 'news', relationships['news'])
30
28
  end
31
29
  end
32
30
 
33
31
  def property_keys
34
- %w[
32
+ %w(
35
33
  api_path web_path price price_currency_code price_usd
36
34
  payment_type acquisition_type acquisition_status disposition_of_acquired
37
35
  announced_on announced_on_trust_code completed_on completed_on_trust_code
38
36
  created_at updated_at
39
- ]
37
+ )
40
38
  end
41
39
 
42
40
  def date_keys
43
- %w[ announced_on completed_on ]
41
+ %w(announced_on completed_on)
44
42
  end
45
-
46
43
  end
47
44
  end
@@ -1,20 +1,18 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  module Crunchbase::Model
4
- class Address < Crunchbase::Model::Entity
5
-
5
+ class Address < Entity
6
6
  RESOURCE_LIST = 'addresses'
7
7
 
8
8
  attr_reader :name, :street_1, :street_2, :postal_code, :city, :city_web_path, :region, :region_code2, :region_web_path,
9
9
  :country, :country_code2, :country_code3, :country_web_path, :latitude, :longitude, :created_at, :updated_at
10
10
 
11
-
12
11
  def property_keys
13
- %w[
12
+ %w(
14
13
  name street_1 street_2 postal_code city city_web_path region region_code2 region_web_path
15
14
  country country_code2 country_code3 country_web_path latitude longitude created_at updated_at
16
- ]
15
+ )
17
16
  end
18
-
19
17
  end
20
18
  end
@@ -1,10 +1,10 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  module Crunchbase::Model
4
- class AdvisoryRole < Crunchbase::Model::Job
5
+ class AdvisoryRole < Job
5
6
  # called advisor_at from people api
6
7
 
7
8
  RESOURCE_LIST = 'advisor_at'
8
-
9
9
  end
10
10
  end
@@ -1,24 +1,25 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  module Crunchbase::Model
4
- class BoardMembersAndAdvisor < Crunchbase::Model::Job
5
-
5
+ class BoardMembersAndAdvisor < Job
6
6
  RESOURCE_LIST = 'board_members_and_advisors'
7
7
 
8
8
  attr_reader :person
9
9
 
10
10
  def initialize(json)
11
11
  super
12
+ end
12
13
 
13
- unless (relationships = json['relationships']).nil?
14
- instance_relationships_object(Crunchbase::Model::Person, 'person', relationships['person'])
15
- end
14
+ def relationship_lists
15
+ {
16
+ 'person' => Person
17
+ }
16
18
  end
17
19
 
18
- # Factory method to return an instance from a permalink
19
- def self.get(permalink)
20
+ # Factory method to return an instance from a permalink
21
+ def self.get(_permalink)
20
22
  nil
21
23
  end
22
-
23
24
  end
24
- end
25
+ end
@@ -1,17 +1,16 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  module Crunchbase::Model
4
- class Category < Crunchbase::Model::Entity
5
-
6
- RESOURCE_LIST = 'categories'
5
+ class Category < Entity
6
+ RESOURCE_LIST = RESOURCE_NAME = 'categories'
7
7
 
8
8
  attr_reader :web_path, :name, :organizations_in_category, :products_in_category, :created_at, :updated_at
9
9
 
10
10
  def property_keys
11
- %w[
11
+ %w(
12
12
  web_path name organizations_in_category products_in_category created_at updated_at
13
- ]
13
+ )
14
14
  end
15
-
16
15
  end
17
- end
16
+ end
@@ -1,7 +1,8 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  module Crunchbase::Model
4
- class Competitor < Crunchbase::Model::Organization
5
+ class Competitor < Organization
5
6
  RESOURCE_LIST = 'competitors'
6
7
  end
7
- end
8
+ end
@@ -1,24 +1,20 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  module Crunchbase::Model
4
- class CurrentTeam < Crunchbase::Model::Job
5
-
5
+ class CurrentTeam < Job
6
6
  RESOURCE_LIST = 'current_team'
7
7
 
8
8
  attr_reader :person
9
9
 
10
10
  def initialize(json)
11
11
  super
12
-
13
- unless (relationships = json['relationships']).nil?
14
- instance_relationships_object(Crunchbase::Model::Person, 'person', relationships['person'])
15
- end
16
12
  end
17
13
 
18
- # Factory method to return an instance from a permalink
19
- def self.get(permalink)
20
- nil
14
+ def relationship_lists
15
+ {
16
+ 'person' => Person
17
+ }
21
18
  end
22
-
23
19
  end
24
- end
20
+ end