Class: PipeDream::Result::Base
- Inherits:
-
Object
- Object
- PipeDream::Result::Base
- Defined in:
- lib/pipe_dream/results/base.rb
Instance Method Summary collapse
- #channel_id ⇒ Object
- #channel_title ⇒ Object
- #description ⇒ Object
-
#initialize(data) ⇒ Base
constructor
A new instance of Base.
- #live_broadcast_content ⇒ Object
- #published_at ⇒ Object (also: #created_at)
-
#thumbnail_url(size = :small) ⇒ Object
TODO: Add thumbnail dimension info?.
- #title ⇒ Object
Constructor Details
#initialize(data) ⇒ Base
Returns a new instance of Base.
4 5 6 |
# File 'lib/pipe_dream/results/base.rb', line 4 def initialize(data) @data = data end |
Instance Method Details
#channel_id ⇒ Object
12 13 14 |
# File 'lib/pipe_dream/results/base.rb', line 12 def channel_id @channel_id ||= snippet.fetch('channelId') end |
#channel_title ⇒ Object
30 31 32 |
# File 'lib/pipe_dream/results/base.rb', line 30 def channel_title @channel_title ||= snippet.fetch('channelTitle') end |
#description ⇒ Object
20 21 22 |
# File 'lib/pipe_dream/results/base.rb', line 20 def description @description ||= snippet.fetch('description') end |
#live_broadcast_content ⇒ Object
34 35 36 |
# File 'lib/pipe_dream/results/base.rb', line 34 def live_broadcast_content @live_broadcast_content ||= snippet.fetch('liveBroadcastContent') end |
#published_at ⇒ Object Also known as: created_at
8 9 10 |
# File 'lib/pipe_dream/results/base.rb', line 8 def published_at @published_at ||= snippet.fetch('publishedAt') end |
#thumbnail_url(size = :small) ⇒ Object
TODO: Add thumbnail dimension info?
25 26 27 28 |
# File 'lib/pipe_dream/results/base.rb', line 25 def thumbnail_url(size = :small) @thumbnail_url ||= snippet.dig('thumbnails', size_mappings.fetch(size, 'default'), 'url') end |
#title ⇒ Object
16 17 18 |
# File 'lib/pipe_dream/results/base.rb', line 16 def title @title ||= snippet.fetch('title') end |