crunchbase_academic 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fcd5a338321941ccb3bbdf48dc8c765d7bf553c9
4
- data.tar.gz: 633c1160070d16ea7a49a86c3d781c54f832e7c8
3
+ metadata.gz: 845e45d0fe3e8b533a266c41cbfdca0cf6f598fc
4
+ data.tar.gz: 1382f02f4f6134f17b4bba35065bf6f00635f817
5
5
  SHA512:
6
- metadata.gz: 75aff44fa9701fefc5b0f75d8d344c16404a4f5ab533d5ed7ffff57eb524896bdda6a710f2756ffb56fa34d694d9313a824e565c642cbba90e96a590839f7486
7
- data.tar.gz: 2b22a3edab12a71cc33317dac4e58bc5918787e35ddd032154575ca6ba9d3b423415d60cb7221bf6c4ffc7550307ed73fb73a1ce04faccf04e8bd25102a709a3
6
+ metadata.gz: ceca48a02d1420e1c4d5c5156720a7082fdcccf20ff1e24ed7f146a52dfa9472708971a25a0850ee3f1aa47f29930bfef12a5616ae7bf5fb0501ef36abc143a5
7
+ data.tar.gz: 9662ee8140b18119f585da364d3a5164a9b533c079f582c6a57977e71d6265d840c61889762cc0caac913cf680ae699aba311153689803c70f795bf1d4b24bae
@@ -20,10 +20,10 @@ module CrunchbaseAcademic
20
20
 
21
21
  private
22
22
 
23
- def self.get_json_response(uri)
23
+ def self.get_json_response(uri)
24
24
  raise CrunchException, "API key required, visit http://developer.crunchbase.com" unless @key
25
25
  uri = uri + "#{uri.match('\?') ? "&" : "?"}user_key=#{@key}"
26
-
26
+
27
27
  resp = Timeout::timeout(@timeout_limit) {
28
28
  get_url_following_redirects(uri, @redirect_limit)
29
29
  }
@@ -41,12 +41,12 @@ module CrunchbaseAcademic
41
41
  url = URI.parse(uri_str)
42
42
  response = Net::HTTP.start(url.host, url.port) { |http| http.get(url.request_uri) }
43
43
  case response
44
- when Net::HTTPSuccess, Net::HTTPNotFound
45
- response.body
46
- when Net::HTTPRedirection
47
- get_url_following_redirects(response['location'], limit - 1)
48
- else
49
- response.error!
44
+ when Net::HTTPSuccess, Net::HTTPNotFound
45
+ response.body
46
+ when Net::HTTPRedirection
47
+ get_url_following_redirects(response['location'], limit - 1)
48
+ else
49
+ response.error!
50
50
  end
51
51
  end
52
52
  end
@@ -0,0 +1,12 @@
1
+ module CrunchbaseAcademic
2
+ class FundingRound < Common
3
+ OBJECT_NAME = 'funding-round'
4
+ attr_reader :money_raised_usd, :announced_on, :announced_on_year
5
+
6
+ def initialize(json)
7
+ @money_raised_usd ||= json['data']['properties']['money_raised_usd']
8
+ @announced_on ||= json['data']['properties']['announced_on']
9
+ @announced_on_year ||= json['data']['properties']['announced_on_year']
10
+ end
11
+ end
12
+ end
@@ -1,9 +1,9 @@
1
1
  module CrunchbaseAcademic
2
2
  class Person < Common
3
3
  OBJECT_NAME = 'person'
4
- attr_reader :first_name, :last_name, :permalink, :birthplace,
5
- :born_on_year, :born_month, :born_day, :born_on, :experience,
6
- :founded_company, :degrees, :advisor_at, :investments
4
+ attr_reader :first_name, :last_name, :permalink, :birthplace,
5
+ :born_on_year, :born_month, :born_day, :born_on, :experience,
6
+ :founded_company, :degrees, :advisor_at, :investments
7
7
 
8
8
  def initialize(json)
9
9
  @permalink ||= json['data']['properties']['permalink']
@@ -0,0 +1,12 @@
1
+ module CrunchbaseAcademic
2
+ class Product < Common
3
+ OBJECT_NAME = 'product'
4
+ attr_reader :permalink, :launched_on, :launched_on_year
5
+
6
+ def initialize(json)
7
+ @permalink ||= json['data']['properties']['permalink']
8
+ @launched_on ||= json['data']['properties']['launched_on']
9
+ @launched_on_year ||= json['data']['properties']['launched_on_year']
10
+ end
11
+ end
12
+ end
@@ -1,3 +1,3 @@
1
1
  module CrunchbaseAcademic
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -3,6 +3,8 @@ require "crunchbase_academic/api"
3
3
  require "crunchbase_academic/common"
4
4
  require "crunchbase_academic/person"
5
5
  require "crunchbase_academic/organization"
6
+ require "crunchbase_academic/product"
7
+ require "crunchbase_academic/funding_round"
6
8
 
7
9
  module CrunchbaseAcademic
8
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crunchbase_academic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - timakin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-03 00:00:00.000000000 Z
11
+ date: 2014-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -70,8 +70,10 @@ files:
70
70
  - lib/crunchbase_academic.rb
71
71
  - lib/crunchbase_academic/api.rb
72
72
  - lib/crunchbase_academic/common.rb
73
+ - lib/crunchbase_academic/funding_round.rb
73
74
  - lib/crunchbase_academic/organization.rb
74
75
  - lib/crunchbase_academic/person.rb
76
+ - lib/crunchbase_academic/product.rb
75
77
  - lib/crunchbase_academic/version.rb
76
78
  - spec/crunchbase_academic_spec.rb
77
79
  - spec/spec_helper.rb