crunchbase_v2 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +25 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.rdoc +88 -0
- data/Rakefile +7 -0
- data/crunchbase.gemspec +24 -0
- data/lib/crunchbase.rb +36 -0
- data/lib/crunchbase/acquisition.rb +66 -0
- data/lib/crunchbase/api.rb +153 -0
- data/lib/crunchbase/board_members_and_advisor.rb +23 -0
- data/lib/crunchbase/category.rb +22 -0
- data/lib/crunchbase/cb_entity.rb +70 -0
- data/lib/crunchbase/competitor.rb +25 -0
- data/lib/crunchbase/crunch_exception.rb +6 -0
- data/lib/crunchbase/current_team.rb +26 -0
- data/lib/crunchbase/customer.rb +21 -0
- data/lib/crunchbase/founder.rb +21 -0
- data/lib/crunchbase/funding_round.rb +69 -0
- data/lib/crunchbase/headquarter.rb +27 -0
- data/lib/crunchbase/image.rb +21 -0
- data/lib/crunchbase/investment.rb +33 -0
- data/lib/crunchbase/ipo.rb +57 -0
- data/lib/crunchbase/location.rb +24 -0
- data/lib/crunchbase/new_item.rb +22 -0
- data/lib/crunchbase/office.rb +28 -0
- data/lib/crunchbase/organization.rb +246 -0
- data/lib/crunchbase/past_team.rb +29 -0
- data/lib/crunchbase/person.rb +31 -0
- data/lib/crunchbase/primary_image.rb +21 -0
- data/lib/crunchbase/product.rb +78 -0
- data/lib/crunchbase/relationship.rb +17 -0
- data/lib/crunchbase/search.rb +45 -0
- data/lib/crunchbase/search_result.rb +11 -0
- data/lib/crunchbase/sub_organization.rb +21 -0
- data/lib/crunchbase/version.rb +3 -0
- data/lib/crunchbase/website.rb +20 -0
- data/spec/apikey.example.yml +2 -0
- data/spec/bootstrap.rb +9 -0
- data/spec/crunchbase/acquisition_spec.rb +26 -0
- data/spec/crunchbase/api_spec.rb +8 -0
- data/spec/crunchbase/board_members_and_advisor_spec.rb +16 -0
- data/spec/crunchbase/category_spec.rb +25 -0
- data/spec/crunchbase/competitor_spec.rb +19 -0
- data/spec/crunchbase/current_team_spec.rb +17 -0
- data/spec/crunchbase/customer_spec.rb +20 -0
- data/spec/crunchbase/founder_spec.rb +20 -0
- data/spec/crunchbase/funding_round_spec.rb +26 -0
- data/spec/crunchbase/headquarter_spec.rb +17 -0
- data/spec/crunchbase/investment_spec.rb +20 -0
- data/spec/crunchbase/ipo_spec.rb +29 -0
- data/spec/crunchbase/location_spec.rb +16 -0
- data/spec/crunchbase/new_item_spec.rb +33 -0
- data/spec/crunchbase/office_spec.rb +19 -0
- data/spec/crunchbase/organization_spec.rb +62 -0
- data/spec/crunchbase/past_team_spec.rb +16 -0
- data/spec/crunchbase/person_spec.rb +23 -0
- data/spec/crunchbase/primary_image_spec.rb +21 -0
- data/spec/crunchbase/product_spec.rb +28 -0
- data/spec/crunchbase/search_result_spec.rb +16 -0
- data/spec/crunchbase/search_spec.rb +17 -0
- data/spec/crunchbase/sub_organization_spec.rb +21 -0
- data/spec/crunchbase/website_spec.rb +25 -0
- data/spec/fixtures/facebook-acquisition.js +82 -0
- data/spec/fixtures/facebook-funding-round.js +96 -0
- data/spec/fixtures/organization-facebook.js +1023 -0
- data/spec/fixtures/person-randi-zuckerberg.js +233 -0
- data/spec/spec_helper.rb +10 -0
- metadata +192 -0
@@ -0,0 +1,28 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
# http://api.crunchbase.com/v/2/organization/facebook/offices
|
4
|
+
|
5
|
+
module Crunchbase
|
6
|
+
class Office < CBEntity
|
7
|
+
RESOURCE_LIST = 'offices'
|
8
|
+
|
9
|
+
attr_reader :type_name, :name, :street_1, :street_2, :city, :city_uuid, :city_path,
|
10
|
+
:region, :country_code, :created_at, :updated_at
|
11
|
+
|
12
|
+
def initialize(json)
|
13
|
+
@type_name = json['type']
|
14
|
+
@name = json['name']
|
15
|
+
@street_1 = json['street_1']
|
16
|
+
@street_2 = json['street_2']
|
17
|
+
@city = json['city']
|
18
|
+
@city_uuid = json['city_uuid']
|
19
|
+
@city_path = json['city_path']
|
20
|
+
@region = json['region']
|
21
|
+
@country_code = json['country_code']
|
22
|
+
@created_at = Time.at(json['created_at']).utc
|
23
|
+
@updated_at = Time.at(json['updated_at']).utc
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
@@ -0,0 +1,246 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'date'
|
3
|
+
|
4
|
+
module Crunchbase
|
5
|
+
class Organization < CBEntity
|
6
|
+
|
7
|
+
RESOURCE_NAME = 'organization'
|
8
|
+
RESOURCE_LIST = 'organizations'
|
9
|
+
|
10
|
+
attr_reader :type_name, :name, :permalink, :description, :short_description,
|
11
|
+
:homepage_url, :founded_on, :is_closed, :closed_on,
|
12
|
+
:primary_role, :total_funding_usd, :number_of_investments,
|
13
|
+
:number_of_employees, :stock_symbol, :stock_exchange,
|
14
|
+
:created_at, :updated_at, :logo_url
|
15
|
+
|
16
|
+
attr_reader :past_teams, :sub_organizations, :current_teams, :acquisitions, :competitors,
|
17
|
+
:offices, :headquarters, :funding_rounds, :categories, :customers, :investments,
|
18
|
+
:founders, :ipos, :products, :primary_images, :images, :websites, :new_items,
|
19
|
+
:board_members_and_advisors
|
20
|
+
|
21
|
+
attr_reader :past_teams_total_items, :sub_organizations_total_items, :current_teams_total_items,
|
22
|
+
:acquisitions_total_items, :competitors_total_items, :offices_total_items,
|
23
|
+
:headquarters_total_items, :funding_rounds_total_items, :categories_total_items,
|
24
|
+
:customers_total_items, :investments_total_items, :founders_total_items,
|
25
|
+
:ipos_total_items, :products_total_items, :primary_images_total_items,
|
26
|
+
:images_total_items, :websites_total_items, :new_items_total_items,
|
27
|
+
:board_members_and_advisors_total_items
|
28
|
+
|
29
|
+
|
30
|
+
def initialize(json)
|
31
|
+
@type_name = json['type']
|
32
|
+
properties = json['properties']
|
33
|
+
relationships = json['relationships']
|
34
|
+
|
35
|
+
@name = properties['name']
|
36
|
+
@permalink = properties['permalink']
|
37
|
+
@description = properties['description']
|
38
|
+
@short_description = properties['short_description']
|
39
|
+
@homepage_url = properties['homepage_url']
|
40
|
+
@founded_on = properties['founded_on'] && DateTime.parse(properties['founded_on'])
|
41
|
+
@is_closed = properties['is_closed']
|
42
|
+
@closed_on = properties['closed_on'] && DateTime.parse(properties['closed_on'])
|
43
|
+
@primary_role = properties['primary_role']
|
44
|
+
@total_funding_usd = properties['total_funding_usd']
|
45
|
+
@number_of_investments = properties['number_of_investments']
|
46
|
+
@number_of_employees = properties['number_of_employees']
|
47
|
+
@stock_symbol = properties['stock_symbol']
|
48
|
+
@stock_exchange = properties['stock_exchange']
|
49
|
+
@created_at = Time.at(properties['created_at']).utc
|
50
|
+
@updated_at = Time.at(properties['updated_at']).utc
|
51
|
+
|
52
|
+
@past_teams_list = relationships['past_team']
|
53
|
+
@sub_organizations_list = relationships['sub_organizations']
|
54
|
+
@current_teams_list = relationships['current_team']
|
55
|
+
@acquisitions_list = relationships['acquisitions']
|
56
|
+
@competitors_list = relationships['competitors']
|
57
|
+
@offices_list = relationships['offices']
|
58
|
+
@headquarters_list = relationships['headquarters']
|
59
|
+
@funding_rounds_list = relationships['funding_rounds']
|
60
|
+
@categories_list = relationships['categories']
|
61
|
+
@customers_list = relationships['customers']
|
62
|
+
@investments_list = relationships['investments']
|
63
|
+
@founders_list = relationships['founders']
|
64
|
+
@ipos_list = relationships['ipo']
|
65
|
+
@products_list = relationships['products']
|
66
|
+
@primary_images_list = relationships['primary_image']
|
67
|
+
@images_list = relationships['images']
|
68
|
+
@websites_list = relationships['websites']
|
69
|
+
@new_items_list = relationships['news']
|
70
|
+
@board_members_and_advisors_list = relationships['board_members_and_advisors']
|
71
|
+
end
|
72
|
+
|
73
|
+
# ================================================================
|
74
|
+
# Relationship objects
|
75
|
+
# %w[ competitors customers founders funding_rounds ipos products sub_organizations ]
|
76
|
+
|
77
|
+
# Organization
|
78
|
+
def competitors
|
79
|
+
@competitors ||= Relationship.array_from_list(@competitors_list)
|
80
|
+
end
|
81
|
+
|
82
|
+
# Organization
|
83
|
+
def customers
|
84
|
+
@customers ||= Relationship.array_from_list(@customers_list)
|
85
|
+
end
|
86
|
+
|
87
|
+
# Person
|
88
|
+
def founders
|
89
|
+
@founders ||= Relationship.array_from_list(@founders_list)
|
90
|
+
end
|
91
|
+
|
92
|
+
# FundingRound
|
93
|
+
def funding_rounds
|
94
|
+
@funding_rounds ||= Relationship.array_from_list(@funding_rounds_list)
|
95
|
+
end
|
96
|
+
|
97
|
+
# Ipo
|
98
|
+
def ipos
|
99
|
+
@ipos ||= Relationship.array_from_list(@ipos_list)
|
100
|
+
end
|
101
|
+
|
102
|
+
# Acquisition
|
103
|
+
def acquisitions
|
104
|
+
@acquisitions ||= Relationship.array_from_list(@acquisitions_list)
|
105
|
+
end
|
106
|
+
|
107
|
+
# Product
|
108
|
+
def products
|
109
|
+
@products ||= Relationship.array_from_list(@products_list)
|
110
|
+
end
|
111
|
+
|
112
|
+
# Organization
|
113
|
+
def sub_organizations
|
114
|
+
@sub_organizations ||= Relationship.array_from_list(@sub_organizations_list)
|
115
|
+
end
|
116
|
+
|
117
|
+
# Get organization other relationship objects
|
118
|
+
def past_teams
|
119
|
+
@past_teams ||= PastTeam.array_from_list(@past_teams_list)
|
120
|
+
end
|
121
|
+
|
122
|
+
def current_teams
|
123
|
+
@current_teams ||= CurrentTeam.array_from_list(@current_teams_list)
|
124
|
+
end
|
125
|
+
|
126
|
+
def offices
|
127
|
+
@offices ||= Office.array_from_list(@offices_list)
|
128
|
+
end
|
129
|
+
|
130
|
+
def headquarters
|
131
|
+
@headquarters ||= Headquarter.array_from_list(@headquarters_list)
|
132
|
+
end
|
133
|
+
|
134
|
+
def categories
|
135
|
+
@categories ||= Category.array_from_list(@categories_list)
|
136
|
+
end
|
137
|
+
|
138
|
+
def investments
|
139
|
+
@investments ||= Investment.array_from_list(@investments_list)
|
140
|
+
end
|
141
|
+
|
142
|
+
def primary_images
|
143
|
+
@primary_images ||= PrimaryImage.array_from_list(@primary_images_list)
|
144
|
+
end
|
145
|
+
|
146
|
+
# Setting current company logo
|
147
|
+
def logo_url
|
148
|
+
@logo_url ||= (primary_images ? (primary_images.first && primary_images.first.path) : nil)
|
149
|
+
end
|
150
|
+
|
151
|
+
def images
|
152
|
+
@images ||= Image.array_from_list(@images_list)
|
153
|
+
end
|
154
|
+
|
155
|
+
def websites
|
156
|
+
@websites ||= Website.array_from_list(@websites_list)
|
157
|
+
end
|
158
|
+
|
159
|
+
def new_items
|
160
|
+
@new_items ||= NewItem.array_from_list(@new_items_list)
|
161
|
+
end
|
162
|
+
|
163
|
+
def board_members_and_advisors
|
164
|
+
@board_members_and_advisors ||= BoardMembersAndAdvisor.array_from_list(@board_members_and_advisors_list)
|
165
|
+
end
|
166
|
+
|
167
|
+
# Get all relationship total_items_count
|
168
|
+
def past_teams_total_items
|
169
|
+
@past_teams_total_items ||= PastTeam.total_items_from_list(@past_teams_list)
|
170
|
+
end
|
171
|
+
|
172
|
+
def sub_organizations_total_items
|
173
|
+
@sub_organizations_total_items ||= SubOrganization.total_items_from_list(@sub_organizations_list)
|
174
|
+
end
|
175
|
+
|
176
|
+
def current_teams_total_items
|
177
|
+
@current_teams_total_items ||= CurrentTeam.total_items_from_list(@current_teams_list)
|
178
|
+
end
|
179
|
+
|
180
|
+
def acquisitions_total_items
|
181
|
+
@acquisitions_total_items ||= Acquisition.total_items_from_list(@acquisitions_list)
|
182
|
+
end
|
183
|
+
|
184
|
+
def competitors_total_items
|
185
|
+
@competitors_total_items ||= Competitor.total_items_from_list(@competitors_list)
|
186
|
+
end
|
187
|
+
|
188
|
+
def offices_total_items
|
189
|
+
@offices_total_items ||= Office.total_items_from_list(@offices_list)
|
190
|
+
end
|
191
|
+
|
192
|
+
def headquarters_total_items
|
193
|
+
@headquarters_total_items ||= Headquarter.total_items_from_list(@headquarters_list)
|
194
|
+
end
|
195
|
+
|
196
|
+
def funding_rounds_total_items
|
197
|
+
@funding_rounds_total_items ||= FundingRound.total_items_from_list(@funding_rounds_list)
|
198
|
+
end
|
199
|
+
|
200
|
+
def categories_total_items
|
201
|
+
@categories_total_items ||= Category.total_items_from_list(@categories_list)
|
202
|
+
end
|
203
|
+
|
204
|
+
def customers_total_items
|
205
|
+
@customers_total_items ||= Customer.total_items_from_list(@customers_list)
|
206
|
+
end
|
207
|
+
|
208
|
+
def investments_total_items
|
209
|
+
@investments_total_items ||= Investment.total_items_from_list(@investments_list)
|
210
|
+
end
|
211
|
+
|
212
|
+
def founders_total_items
|
213
|
+
@founders_total_items ||= Founder.total_items_from_list(@founders_list)
|
214
|
+
end
|
215
|
+
|
216
|
+
def ipos_total_items
|
217
|
+
@ipos_total_items ||= Ipo.total_items_from_list(@ipos_list)
|
218
|
+
end
|
219
|
+
|
220
|
+
def products_total_items
|
221
|
+
@products_total_items ||= Product.total_items_from_list(@products_list)
|
222
|
+
end
|
223
|
+
|
224
|
+
def primary_images_total_items
|
225
|
+
@primary_images_total_items ||= PrimaryImage.total_items_from_list(@primary_images_list)
|
226
|
+
end
|
227
|
+
|
228
|
+
def images_total_items
|
229
|
+
@images_total_items ||= Image.total_items_from_list(@images_list)
|
230
|
+
end
|
231
|
+
|
232
|
+
def websites_total_items
|
233
|
+
@websites_total_items ||= Website.total_items_from_list(@websites_list)
|
234
|
+
end
|
235
|
+
|
236
|
+
def new_items_total_items
|
237
|
+
@new_items_total_items ||= NewItem.total_items_from_list(@new_items_list)
|
238
|
+
end
|
239
|
+
|
240
|
+
def board_members_and_advisors_total_items
|
241
|
+
@board_members_and_advisors_total_items ||= BoardMembersAndAdvisor.total_items_from_list(@board_members_and_advisors_list)
|
242
|
+
end
|
243
|
+
|
244
|
+
end
|
245
|
+
|
246
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
# http://api.crunchbase.com/v/2/organization/facebook/past_team
|
4
|
+
|
5
|
+
require 'date'
|
6
|
+
|
7
|
+
module Crunchbase
|
8
|
+
class PastTeam < CBEntity
|
9
|
+
RESOURCE_LIST = 'past_team'
|
10
|
+
|
11
|
+
attr_reader :type_name, :name, :first_name, :last_name, :path, :permalink, :title, :started_on,
|
12
|
+
:ended_on, :created_at, :updated_at
|
13
|
+
|
14
|
+
def initialize(json)
|
15
|
+
@type_name = json['type']
|
16
|
+
@name = json['first_name'].to_s + ' ' + json['last_name'].to_s
|
17
|
+
@first_name = json['first_name']
|
18
|
+
@last_name = json['last_name']
|
19
|
+
@path = json['path']
|
20
|
+
@permalink = (json['permalink'] || (json['path'] && json['path'].gsub('person/', '')))
|
21
|
+
@title = json['title']
|
22
|
+
@started_on = json['started_on'] && DateTime.parse(json['started_on'])
|
23
|
+
@ended_on = json['ended_on'] && DateTime.parse(json['ended_on'])
|
24
|
+
@created_at = Time.at(json['created_at']).utc
|
25
|
+
@updated_at = Time.at(json['updated_at']).utc
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
# http://api.crunchbase.com/v/2/person/randi-zuckerberg?user_key=key
|
4
|
+
|
5
|
+
module Crunchbase
|
6
|
+
class Person < CBEntity
|
7
|
+
RESOURCE_NAME = 'person'
|
8
|
+
RESOURCE_LIST = 'people'
|
9
|
+
|
10
|
+
attr_reader :type_name, :name, :first_name, :last_name, :permalink, :bio, :born_on, :died_on,
|
11
|
+
:is_deceased, :created_at, :updated_at
|
12
|
+
|
13
|
+
def initialize(json)
|
14
|
+
@type_name = json['type']
|
15
|
+
properties = json['properties']
|
16
|
+
|
17
|
+
@name = properties['first_name'] + ' ' + properties['last_name']
|
18
|
+
@first_name = properties['first_name']
|
19
|
+
@last_name = properties['last_name']
|
20
|
+
@permalink = properties['permalink']
|
21
|
+
@bio = properties['bio']
|
22
|
+
@born_on = properties['born_on'] && DateTime.parse(properties['born_on'])
|
23
|
+
@died_on = properties['died_on'] && DateTime.parse(properties['died_on'])
|
24
|
+
@is_deceased = properties['is_deceased']
|
25
|
+
@created_at = Time.at(properties['created_at']).utc
|
26
|
+
@updated_at = Time.at(properties['updated_at']).utc
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# encode: utf-8
|
2
|
+
|
3
|
+
# http://api.crunchbase.com/v/2/organization/facebook/primary_image
|
4
|
+
|
5
|
+
module Crunchbase
|
6
|
+
class PrimaryImage < CBEntity
|
7
|
+
RESOURCE_LIST = 'primary_image'
|
8
|
+
|
9
|
+
attr_reader :type_name, :title, :path, :original_path, :created_at, :updated_at
|
10
|
+
|
11
|
+
def initialize(json)
|
12
|
+
@type_name = json['type']
|
13
|
+
@title = json['title']
|
14
|
+
@original_path = json['path']
|
15
|
+
@path = Crunchbase::API.image_url + json['path']
|
16
|
+
@created_at = Time.at(json['created_at']).utc
|
17
|
+
@updated_at = Time.at(json['updated_at']).utc
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
# http://api.crunchbase.com/v/2/organization/facebook/products
|
4
|
+
|
5
|
+
require 'date'
|
6
|
+
|
7
|
+
module Crunchbase
|
8
|
+
class Product < CBEntity
|
9
|
+
RESOURCE_NAME = 'product'
|
10
|
+
RESOURCE_LIST = 'products'
|
11
|
+
|
12
|
+
attr_reader :type_name, :lifecycle_stage, :owner_id, :short_description, :permalink, :name,
|
13
|
+
:homepage_url, :description, :launched_on, :launched_on_trust_code,
|
14
|
+
:created_at, :updated_at
|
15
|
+
|
16
|
+
attr_reader :primary_images, :images, :websites, :new_items
|
17
|
+
attr_reader :primary_images_total_items, :images_total_items, :websites_total_items,
|
18
|
+
:new_items_total_items
|
19
|
+
|
20
|
+
def initialize(json)
|
21
|
+
properties = json['properties']
|
22
|
+
relationships = json['relationships']
|
23
|
+
|
24
|
+
@type_name = properties['type']
|
25
|
+
@name = properties['name']
|
26
|
+
@lifecycle_stage = properties['lifecycle_stage']
|
27
|
+
@owner_id = properties['owner_id']
|
28
|
+
@short_description = properties['short_description']
|
29
|
+
@permalink = properties['permalink']
|
30
|
+
@homepage_url = properties['homepage_url']
|
31
|
+
@description = properties['description']
|
32
|
+
@launched_on = properties['launched_on'] && DateTime.parse(properties['launched_on'])
|
33
|
+
@created_at = Time.at(properties['created_at']).utc
|
34
|
+
@updated_at = Time.at(properties['updated_at']).utc
|
35
|
+
@launched_on_trust_code = properties['launched_on_trust_code']
|
36
|
+
|
37
|
+
|
38
|
+
@primary_images_list = relationships['primary_image']
|
39
|
+
@images_list = relationships['images']
|
40
|
+
@websites_list = relationships['websites']
|
41
|
+
@new_items_list = relationships['news']
|
42
|
+
end
|
43
|
+
|
44
|
+
def primary_images
|
45
|
+
@primary_images ||= PrimaryImage.array_from_list(@primary_images_list)
|
46
|
+
end
|
47
|
+
|
48
|
+
def images
|
49
|
+
@images ||= Image.array_from_list(@images_list)
|
50
|
+
end
|
51
|
+
|
52
|
+
def websites
|
53
|
+
@websites ||= Website.array_from_list(@websites_list)
|
54
|
+
end
|
55
|
+
|
56
|
+
def new_items
|
57
|
+
@new_items ||= NewItem.array_from_list(@new_items_list)
|
58
|
+
end
|
59
|
+
|
60
|
+
def primary_images_total_items
|
61
|
+
@primary_images_total_items ||= PrimaryImage.total_items_from_list(@primary_images_list)
|
62
|
+
end
|
63
|
+
|
64
|
+
def images_total_items
|
65
|
+
@images_total_items ||= Image.total_items_from_list(@images_list)
|
66
|
+
end
|
67
|
+
|
68
|
+
def websites_total_items
|
69
|
+
@websites_total_items ||= Website.total_items_from_list(@websites_list)
|
70
|
+
end
|
71
|
+
|
72
|
+
def new_items_total_items
|
73
|
+
@new_items_total_items ||= NewItem.total_items_from_list(@new_items_list)
|
74
|
+
end
|
75
|
+
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module Crunchbase
|
4
|
+
class Relationship < CBEntity
|
5
|
+
attr_reader :name, :type_name, :path, :permalink, :created_at, :updated_at
|
6
|
+
|
7
|
+
def initialize(hash)
|
8
|
+
@type_name = hash["type"]
|
9
|
+
@name = hash["name"]
|
10
|
+
@path = hash["path"]
|
11
|
+
@permalink = hash["path"].split('/').last
|
12
|
+
@created_at = hash['created_at'] && Time.at(hash['created_at']).utc
|
13
|
+
@updated_at = hash['updated_at'] && Time.at(hash['updated_at']).utc
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|