Class: Crunchbase::PrimaryImage

Inherits:
CBEntity
  • Object
show all
Defined in:
lib/crunchbase/primary_image.rb

Constant Summary collapse

RESOURCE_LIST =
'primary_image'

Constants inherited from CBEntity

CBEntity::RELATIONSHIPS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from CBEntity

array_from_list, #fetch, get, list, lists_for_permalink, search, total_items_from_list

Constructor Details

#initialize(json) ⇒ PrimaryImage

Returns a new instance of PrimaryImage.



11
12
13
14
15
16
17
18
# File 'lib/crunchbase/primary_image.rb', line 11

def initialize(json)
  @type_name      = json['type']
  @title          = json['title']
  @original_path  = json['path']
  @path           = json['path'] && (Crunchbase::API.image_url + json['path'])
  @created_at     = Time.at(json['created_at']).utc
  @updated_at     = Time.at(json['updated_at']).utc
end

Instance Attribute Details

#created_atObject (readonly)

Returns the value of attribute created_at.



9
10
11
# File 'lib/crunchbase/primary_image.rb', line 9

def created_at
  @created_at
end

#original_pathObject (readonly)

Returns the value of attribute original_path.



9
10
11
# File 'lib/crunchbase/primary_image.rb', line 9

def original_path
  @original_path
end

#pathObject (readonly)

Returns the value of attribute path.



9
10
11
# File 'lib/crunchbase/primary_image.rb', line 9

def path
  @path
end

#titleObject (readonly)

Returns the value of attribute title.



9
10
11
# File 'lib/crunchbase/primary_image.rb', line 9

def title
  @title
end

#type_nameObject (readonly)

Returns the value of attribute type_name.



9
10
11
# File 'lib/crunchbase/primary_image.rb', line 9

def type_name
  @type_name
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



9
10
11
# File 'lib/crunchbase/primary_image.rb', line 9

def updated_at
  @updated_at
end