Class: Crunchbase::NewItem

Inherits:
CBEntity show all
Defined in:
lib/crunchbase/new_item.rb

Constant Summary collapse

RESOURCE_LIST =
'news'

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) ⇒ NewItem

Returns a new instance of NewItem.



12
13
14
15
16
17
18
19
20
# File 'lib/crunchbase/new_item.rb', line 12

def initialize(json)
  @type_name      = json['type']
  @url            = json['url']
  @author         = json['author']
  @posted_on      = json['posted_on'] && DateTime.parse(json['posted_on'])
  @title          = json['title']
  @created_at     = json['created_at']
  @updated_at     = json['updated_at']
end

Instance Attribute Details

#authorObject (readonly)

Returns the value of attribute author.



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

def author
  @author
end

#created_atObject (readonly)

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#posted_onObject (readonly)

Returns the value of attribute posted_on.



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

def posted_on
  @posted_on
end

#titleObject (readonly)

Returns the value of attribute title.



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

def title
  @title
end

#typeObject (readonly)

Returns the value of attribute type.



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

def type
  @type
end

#type_nameObject (readonly)

Returns the value of attribute type_name.



9
10
11
# File 'lib/crunchbase/new_item.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/new_item.rb', line 9

def updated_at
  @updated_at
end

#urlObject (readonly)

Returns the value of attribute url.



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

def url
  @url
end