Class: Howcast::Client::Playlist

Inherits:
Object
  • Object
show all
Extended by:
WatchAttrAccessors
Includes:
XmlMethods
Defined in:
lib/howcast/client/playlist.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from WatchAttrAccessors

attr_accessor, attr_accessors

Methods included from XmlMethods

#to_doc, #to_xml

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

#descriptionObject

Returns the value of attribute description.



29
30
31
# File 'lib/howcast/client/playlist.rb', line 29

def description
  @description
end

#idObject

Returns the value of attribute id.



29
30
31
# File 'lib/howcast/client/playlist.rb', line 29

def id
  @id
end

#playlist_thumbnail_urlObject

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

#titleObject

Returns the value of attribute title.



29
30
31
# File 'lib/howcast/client/playlist.rb', line 29

def title
  @title
end

#videosObject

Returns the value of attribute videos.



29
30
31
# File 'lib/howcast/client/playlist.rb', line 29

def videos
  @videos
end