Hello!

I have this situation where I'd like to allow other developers to write
code that works with some other code I'm writing. Basically, I'd like to
say "please implement a class which has at least these specific methods and
gives me data in this format, and tell me (the code) what this class is so
I can call methods on it and use the return values". A little bit like
Interfaces in languages like Java or Obj-C allow you to do. It doesn't have
to be as flexible as a full blown plugin system!

The actual use case, if it helps clarify my question - I've written code
(in Rails)  which collates statistics for reporting on e-learning apps
(also in Rails, some part of the same app and some completely separate
Rails apps) and developers of these apps would like to provide this info,
such as "number of lessons passed", "time studied" etc. without having to
know too much of the specifics of the reporting code like what models/db
tables are used, or how it collates the info etc.

My question is - how do you normally handle this in Ruby. Through good
documentation? A certain coding pattern? A gem?

Thanks!

Robert

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
or Rails Oceania" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rails-oceania?hl=en.

Reply via email to