I've got a module called AB. Right now it looks something like this:
module AB
extend self
def some_method(hash)
....
end
....
end
We use it like this: AB.some_method(:thing=>:whatever,:etc=>'you get the idea'). There are about a half-dozen strings that the user has to pass in that I'd like to turn into dynamic methods so that instead of AB.some_method(:thing => :whatever...) They'd just call AB.whatever(...) or AB::whatever(...). I thought I could do this with method_missing, but I guess I don't get it. I did something like this:
module AB
def method_missing(name,*args)
super unless THINGS.include?(name.to_s)
...
end
end
But I never get into that method when trying to call AB::whatever. I thought about looping over THINGS and using define_method, but I wasn't sure how to define methods that take arguments.
Any help appreciated.