<Toplevel Module>
Simpleton
—
#1
ClassMethods
—
#7
has properties |
|
1 module Simpleton 2 3 def self.included(base) 4 base.extend(ClassMethods) 5 end 6 7 module ClassMethods 8 9 def instance(&block) 10 @instance ||= new 11 block.call(@instance) if block_given? 12 @instance 13 end 14 15 def method_missing(method, *args, &block) 16 instance.respond_to?(method) ? instance.send(method, *args, &block) : super 17 end 18 19 end 20 21 en