Class: Google::Search::Item::News

Inherits:
Google::Search::Item show all
Defined in:
lib/google-search/item/news.rb

Instance Attribute Summary collapse

Attributes inherited from Google::Search::Item

#content, #index, #thumbnail_height, #thumbnail_uri, #thumbnail_width, #title, #uri, #visible_uri

Instance Method Summary collapse

Methods inherited from Google::Search::Item

class_for

Constructor Details

#initialize(hash) ⇒ News

Initialize with hash.


35
36
37
38
39
40
41
42
# File 'lib/google-search/item/news.rb', line 35

def initialize hash
  super
  @location = hash['location']
  @published = DateTime.parse hash['publishedDate']
  @language = hash['language']
  @publisher = hash['publisher']
  @redirect_uri = hash['signedRedirectUrl']
end

Instance Attribute Details

#languageObject (readonly)

Language.


25
26
27
# File 'lib/google-search/item/news.rb', line 25

def language
  @language
end

#locationObject (readonly)

Location.


20
21
22
# File 'lib/google-search/item/news.rb', line 20

def location
  @location
end

#publishedObject (readonly)

Published DateTime.


10
11
12
# File 'lib/google-search/item/news.rb', line 10

def published
  @published
end

#publisherObject (readonly)

Publisher.


15
16
17
# File 'lib/google-search/item/news.rb', line 15

def publisher
  @publisher
end

#redirect_uriObject (readonly)

Redirect uri.


30
31
32
# File 'lib/google-search/item/news.rb', line 30

def redirect_uri
  @redirect_uri
end