Method: Playlist#initialize

Defined in:
lib/playlist.rb

#initialize(attr = {}) {|_self| ... } ⇒ Playlist

Create a new Playlist

Parameters:

  • attr (Hash) (defaults to: {})

    a hash of attibute values to set

Yields:

  • (_self)

Yield Parameters:

  • _self (Playlist)

    the object that the method was called on



45
46
47
48
49
50
51
52
53
# File 'lib/playlist.rb', line 45

def initialize(attr = {})
  @tracks = []
  @identifiers = {}
  attr.each_pair do |key, value|
    send("#{key}=", value)
  end

  yield(self) if block_given?
end