Sha256: e5b025c482de88a6329d2621c2a025c44d4acaabcbfcd82d9526a0d047654014

Contents?: true

Size: 511 Bytes

Versions: 6

Compression:

Stored size: 511 Bytes

Contents

class Song

  attr_accessor :title, :year, :artist, :options

  def initialize(title, year, artist, options={})
    self.title = title
    self.year = year
    self.artist = artist
    self.options = options
  end

  def can_be_playlisted?
    metadata[:playlist]
  end

  def can_be_downloaded?
    metadata[:download]
  end

  def drm_enabled?
    options['drm_enabled']
  end

  def metadata
    {
      :playlist => options[:available_to_playlist],
      :download => options[:downloadable]
    }
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
snuffle-0.12.2 spec/fixtures/program_1.rb
snuffle-0.12.1 spec/fixtures/program_1.rb
snuffle-0.12.0 spec/fixtures/program_1.rb
snuffle-0.11.1 spec/fixtures/program_1.rb
snuffle-0.10.1 spec/fixtures/program_1.rb
snuffle-0.9.1 spec/fixtures/program_1.rb