I’m trying to create a module that will have class and instance methods
that are made available to any object that includes it. I can do the
job with two lines of code but would prefer to do it with one line of
code if possible (to make sure no one tries to foolishly use only one
half of the functionality - it should be all or nothing). Here’s what I
have so far:
live = Live.new
My code can get the class methods fine - “object.extend” works like a
charm: I can’t figure out what the equivalent is for an instance
Or perhaps there’s a wonderful way to do this using entirely different
syntax? I’d love to be able to say: “extend Modules::Ver” or something
like that and have it work - but it seems that no code gets executed
that’s left open in the Ver module when that module is included or
Any thoughts or ideas?
Thank you for any help!
The law is an envious monster.
- Rex Stout