Wow, okay that’s a tall set of requirements, I don’t want to discourage
but doing something like this is non-trivial in any environment, and it
sounds like you want to create a domain specific language from disparate
data sources which Ruby actually excels at doing, but the true measure
how easy or hard this will be to do in Ruby also depends on how
you are with these concepts.
Firstly, the M in MVC is for Model and in Rails model objects are
represented as classes. If you are comfortable with object oriented
programming then you can create plain old ruby classes that can
business logic data within them. They can be used by Rails or they can
used by any other device that can access a plain old .rb file, including
consoles and windowed gui applications. Additionally, if you want to
them up to a database then you can subclass these objects to inherit
Rails ActiveRecord which provides an ORM solution to persist to a db,
you choose to do this then you should be aware of ActiveRecord
for tables and objects. Now these model objects can exist and be used
within the context of a Rails application or outside of it, they do not
coupled to the controller and view, and thus you already have achieved a
three-tier scenerio, by virtue of the way Rails is designed.
Now the hardest part of what you are describing will be gathering data
all the different sources you listed and turning them into a common
model, because you are asking to do this I’m assuming you know what you
getting into and so I’m going to point you to an article that may be a
This article describes creating a Domain Specific Language in Ruby,
I’m guessing is what you are attempting to do.
As for answering your original question my answer remains the same in
your best bet is to place your business logic into classes in the model
best represent the behaviors of the objects you are trying to model.