--nextPart3091546.ppBQVWCsWL Content-Type: text/plain; charset s-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hello. I have a class and a module. I want to extend a class with a particular method that is defined in a module. I have come up to the following example code, but i am not sure how to implement a Operational::Behavior#proc method. Could some one please help me in this? Or may be prompt a better implementation? ==================================================== class SomeClass include Operational operational_as :bob end module Operational def self.included(base) base.extend ClassMethods end module ClassMethods def operational_as(method) klass = class << self; self; end klass.instance_eval do define_method(method.to_sym, Behavior.proc(method.to_sym)) end end end module Behavior def self.proc(method) end private def bob ... end def sam ... end end end ========================================= -- ====================================================================== - Best regards, Nikolay Pavlov. <<<----------------------------------- ====================================================================== --nextPart3091546.ppBQVWCsWL Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQBHKdrf/2R6KvEYGaIRAtGUAJsHpk4smmbSYZN+K5e+Gt3Y2lOUUACg3rzy ulq/HAE2kyPmDAsGgKOyjK4 1Q -----END PGP SIGNATURE----- --nextPart3091546.ppBQVWCsWL--