lib/radiodan/track.rb in radiodan-0.0.4 vs lib/radiodan/track.rb in radiodan-1.0.0

- old
+ new

@@ -2,18 +2,21 @@ require 'active_support/core_ext/hash/indifferent_access' class Radiodan class Track class NoFileError < Exception; end - extend Forwardable + extend Forwardable + attr_reader :attributes def_delegators :@attributes, :[] + alias_method :eql?, :== def initialize(attributes={}) @attributes = HashWithIndifferentAccess.new(attributes) - raise NoFileError, 'No file given for track' \ - unless @attributes.include?(:file) + unless @attributes.has_key?(:file) + raise NoFileError, 'No file given for track' + end end def ==(other) self[:file] == other[:file] end