Remapping design issue
- by Sirupsen
Hello,
I'm currently developing a Ruby Gem and I'm a bit lost on the design currently.
Basically, I'm remapping some APIs, so my skeleton is something like this:
module MyApp
module SomeApi
class Function > Base::Function
...
end
class Function2 > Base::Function2
...
end
...
end
module SomeApi2
...
end
class RemappedFunction
def initalize
# set some values and stuf
...
end
def remapped_method
# Problem:
# How would I know, if I should take contact to
# SomeApi, or SomeApi2?
end
end
def interact_with(api)
# What would be the best way of letting RemappedFunction
# know which API to use?
end
end
someapi2 = MyApp.interact_with(:someapi2)
someapi2.remapped_method
Any ideas?