Module: WahWah::TagDelegate

Included in:
Mp3Tag, OggTag, RiffTag
Defined in:
lib/wahwah/tag_delegate.rb

Instance Method Summary collapse

Instance Method Details

#tag_delegate(accessor, *attributes) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/wahwah/tag_delegate.rb', line 5

def tag_delegate(accessor, *attributes)
  attributes.each do |attr|
    define_method(attr) do
      tag = instance_variable_get(accessor)

      return super() if tag.nil?
      tag.send(attr)
    end
  end
end