Class: RSpotify::Episode
Instance Attribute Summary collapse
-
#audio_preview_url ⇒ String
A URL to a 30 second preview (MP3 format) of the episode.
-
#description ⇒ String
A description of the episode.
-
#duration_ms ⇒ Integer
The episode length in milliseconds.
-
#explicit ⇒ Boolean
Whether or not the episode has explicit content (true = yes it does; false = no it does not OR unknown).
-
#href ⇒ String
A link to the Web API endpoint providing full details of the episode.
-
#html_description ⇒ String
A description of the episode.
-
#images ⇒ Array<Hash>
The cover art for the episode in various sizes, widest first.
-
#is_externally_hosted ⇒ Boolean
True if the episode is hosted outside of Spotify’s CDN.
-
#is_playable ⇒ Boolean
True if the episode is playable in the given market.
-
#language ⇒ String
The language used in the episode, identified by a ISO 639 code.
-
#languages ⇒ Array<String>
A list of the languages used in the episode, identified by their ISO 639-1 code.
-
#name ⇒ String
The name of the episode.
-
#release_date ⇒ String
The date the episode was first released, for example “1981-12-15”.
-
#release_date_precision ⇒ String
The precision with which release_date value is known.
-
#restrictions ⇒ Hash
Included in the response when a content restriction is applied.
-
#resume_point ⇒ Hash
The user’s most recent position in the episode.
Attributes inherited from Base
#external_urls, #id, #type, #uri
Class Method Summary collapse
-
.find(ids, market: nil) ⇒ Episode+
Returns Episode object(s) with id(s) provided.
-
.search(query, limit: 20, offset: 0, market: nil) ⇒ Array<Episode>
Returns array of Episode objects matching the query.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Episode
constructor
A new instance of Episode.
Methods inherited from Base
#complete!, #embed, #method_missing, #respond_to?
Constructor Details
#initialize(options = {}) ⇒ Episode
Returns a new instance of Episode.
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/rspotify/episode.rb', line 58 def initialize( = {}) @audio_preview_url = ['audio_preview_url'] @description = ['description'] @duration_ms = ['duration_ms'] @explicit = ['explicit'] @href = ['href'] @html_description = ['html_description'] @images = ['images'] @is_externally_hosted = ['is_externally_hosted'] @is_playable = ['is_playable'] @language = ['language'] @languages = ['languages'] @name = ['name'] @release_date = ['release_date'] @release_date_precision = ['release_date_precision'] @restrictions = ['restrictions'] || {} @resume_point = ['resume_point'] || {} @uri = ['uri'] @show = if ['show'] Show.new ['show'] end super() end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class RSpotify::Base
Instance Attribute Details
#audio_preview_url ⇒ String
A URL to a 30 second preview (MP3 format) of the episode. null if not available.
19 20 21 |
# File 'lib/rspotify/episode.rb', line 19 def audio_preview_url @audio_preview_url end |
#description ⇒ String
A description of the episode. HTML tags are stripped away from this field, use html_description field in case HTML tags are needed.
19 20 21 |
# File 'lib/rspotify/episode.rb', line 19 def description @description end |
#duration_ms ⇒ Integer
The episode length in milliseconds.
19 20 21 |
# File 'lib/rspotify/episode.rb', line 19 def duration_ms @duration_ms end |
#explicit ⇒ Boolean
Whether or not the episode has explicit content (true = yes it does; false = no it does not OR unknown).
19 20 21 |
# File 'lib/rspotify/episode.rb', line 19 def explicit @explicit end |
#href ⇒ String
A link to the Web API endpoint providing full details of the episode.
19 20 21 |
# File 'lib/rspotify/episode.rb', line 19 def href @href end |
#html_description ⇒ String
A description of the episode. This field may contain HTML tags.
19 20 21 |
# File 'lib/rspotify/episode.rb', line 19 def html_description @html_description end |
#images ⇒ Array<Hash>
The cover art for the episode in various sizes, widest first.
19 20 21 |
# File 'lib/rspotify/episode.rb', line 19 def images @images end |
#is_externally_hosted ⇒ Boolean
True if the episode is hosted outside of Spotify’s CDN.
19 20 21 |
# File 'lib/rspotify/episode.rb', line 19 def is_externally_hosted @is_externally_hosted end |
#is_playable ⇒ Boolean
True if the episode is playable in the given market. Otherwise false.
19 20 21 |
# File 'lib/rspotify/episode.rb', line 19 def is_playable @is_playable end |
#language ⇒ String
The language used in the episode, identified by a ISO 639 code. This field is deprecated and might be removed in the future. Please use the languages field instead.
19 20 21 |
# File 'lib/rspotify/episode.rb', line 19 def language @language end |
#languages ⇒ Array<String>
A list of the languages used in the episode, identified by their ISO 639-1 code.
19 20 21 |
# File 'lib/rspotify/episode.rb', line 19 def languages @languages end |
#name ⇒ String
The name of the episode.
19 20 21 |
# File 'lib/rspotify/episode.rb', line 19 def name @name end |
#release_date ⇒ String
The date the episode was first released, for example “1981-12-15”. Depending on the precision, it might be shown as “1981” or “1981-12”.
19 20 21 |
# File 'lib/rspotify/episode.rb', line 19 def release_date @release_date end |
#release_date_precision ⇒ String
The precision with which release_date value is known.
19 20 21 |
# File 'lib/rspotify/episode.rb', line 19 def release_date_precision @release_date_precision end |
#restrictions ⇒ Hash
Included in the response when a content restriction is applied.
19 20 21 |
# File 'lib/rspotify/episode.rb', line 19 def restrictions @restrictions end |
#resume_point ⇒ Hash
The user’s most recent position in the episode. Set if the supplied access token is a user token and has the scope ‘user-read-playback-position’.
19 20 21 |
# File 'lib/rspotify/episode.rb', line 19 def resume_point @resume_point end |
Class Method Details
.find(ids, market: nil) ⇒ Episode+
Returns Episode object(s) with id(s) provided
36 37 38 |
# File 'lib/rspotify/episode.rb', line 36 def self.find(ids, market: nil) super(ids, 'episode', market: market) end |
.search(query, limit: 20, offset: 0, market: nil) ⇒ Array<Episode>
Returns array of Episode objects matching the query. It’s also possible to find the total number of search results for the query
54 55 56 |
# File 'lib/rspotify/episode.rb', line 54 def self.search(query, limit: 20, offset: 0, market: nil ) super(query, 'episode', limit: limit, offset: offset, market: market) end |