Module: Mp3Info::HashKeys

Included in:
ID3v2
Defined in:
lib/mp3info/extension_modules.rb

Overview

:nodoc:

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args) ⇒ Object

lets you specify hash as hash.key this came from CodingInRuby on RubyGarden www.rubygarden.org/ruby?CodingInRuby



10
11
12
13
14
15
16
17
# File 'lib/mp3info/extension_modules.rb', line 10

def method_missing(meth,*args)
  m = meth.id2name
  if /=$/ =~ m
	self[m.chop] = (args.length<2 ? args[0] : args)
  else
	self[m]
  end
end