multiple classes question

M

Marcelo Barbudas

Hi.

I need to create a class "Getter" that exposes a method "retrieve"
implemented differently depending on what backend is chosen.

The public API could be something like:
getter = Getter.new:)backend => "DB")
getter.retrieve (where retrieve is implemented in a separate module or
class called DB)

What's the best way to design such a class/module structure?

-M.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,265
Messages
2,571,071
Members
48,771
Latest member
ElysaD

Latest Threads

Top