Class: Google::Search::Item::Video
- Inherits:
-
Google::Search::Item
- Object
- Google::Search::Item
- Google::Search::Item::Video
- Defined in:
- lib/google-search/item/video.rb
Instance Attribute Summary collapse
-
#duration ⇒ Object
readonly
Duration in seconds.
-
#published ⇒ Object
readonly
Published DateTime.
-
#publisher ⇒ Object
readonly
Publisher.
-
#rating ⇒ Object
readonly
Rating float.
-
#type ⇒ Object
readonly
Video type.
Attributes inherited from Google::Search::Item
#content, #index, #thumbnail_height, #thumbnail_uri, #thumbnail_width, #title, #uri, #visible_uri
Instance Method Summary collapse
-
#initialize(hash) ⇒ Video
constructor
Initialize with hash.
Methods inherited from Google::Search::Item
Constructor Details
#initialize(hash) ⇒ Video
Initialize with hash.
35 36 37 38 39 40 41 42 |
# File 'lib/google-search/item/video.rb', line 35 def initialize hash super @rating = hash['rating'].to_f @type = hash['videoType'] @publisher = hash['publisher'] @published = DateTime.parse hash['published'] @duration = hash['duration'].to_i end |
Instance Attribute Details
#duration ⇒ Object (readonly)
Duration in seconds.
30 31 32 |
# File 'lib/google-search/item/video.rb', line 30 def duration @duration end |
#published ⇒ Object (readonly)
Published DateTime.
25 26 27 |
# File 'lib/google-search/item/video.rb', line 25 def published @published end |
#publisher ⇒ Object (readonly)
Publisher.
20 21 22 |
# File 'lib/google-search/item/video.rb', line 20 def publisher @publisher end |
#rating ⇒ Object (readonly)
Rating float.
10 11 12 |
# File 'lib/google-search/item/video.rb', line 10 def @rating end |
#type ⇒ Object (readonly)
Video type.
15 16 17 |
# File 'lib/google-search/item/video.rb', line 15 def type @type end |