Class: Howcast::Client::Playlist
- Inherits:
-
Object
- Object
- Howcast::Client::Playlist
- Extended by:
- WatchAttrAccessors
- Includes:
- XmlMethods
- Defined in:
- lib/howcast/client/playlist.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#id ⇒ Object
Returns the value of attribute id.
-
#playlist_thumbnail_url ⇒ Object
Returns the value of attribute playlist_thumbnail_url.
-
#title ⇒ Object
Returns the value of attribute title.
-
#videos ⇒ Object
Returns the value of attribute videos.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Playlist
constructor
Creates a new Playlist object which is used to encapsulate all the attributes available from the Howcast playlist API.
Methods included from WatchAttrAccessors
Methods included from XmlMethods
Constructor Details
#initialize(attributes = {}) ⇒ Playlist
Creates a new Playlist object which is used to encapsulate all the attributes available from the Howcast playlist API.
Inputs
-
attributes
– A hash to set the various attributes of the playlist object
Examples
Initialize a playlist with title “My Playlist”
Playlist.new :title => "My Playlist"
42 43 44 45 46 47 48 49 50 |
# File 'lib/howcast/client/playlist.rb', line 42 def initialize(attributes={}) attributes.each do |k, v| if k == :title self.send("#{k}=", v.gsub(/^Howcast - /, '')) if self.respond_to?(k) else self.send("#{k}=", v) if self.respond_to?(k) end end end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
29 30 31 |
# File 'lib/howcast/client/playlist.rb', line 29 def description @description end |
#id ⇒ Object
Returns the value of attribute id.
29 30 31 |
# File 'lib/howcast/client/playlist.rb', line 29 def id @id end |
#playlist_thumbnail_url ⇒ Object
Returns the value of attribute playlist_thumbnail_url.
29 30 31 |
# File 'lib/howcast/client/playlist.rb', line 29 def playlist_thumbnail_url @playlist_thumbnail_url end |
#title ⇒ Object
Returns the value of attribute title.
29 30 31 |
# File 'lib/howcast/client/playlist.rb', line 29 def title @title end |
#videos ⇒ Object
Returns the value of attribute videos.
29 30 31 |
# File 'lib/howcast/client/playlist.rb', line 29 def videos @videos end |