Sha256: af611a06243a946b225c0e3651a4555b8c45adb816fcd0dd6c45684e99a04d84
Contents?: true
Size: 583 Bytes
Versions: 23
Compression:
Stored size: 583 Bytes
Contents
require 'singleton' module RightSupport::Ruby module EasySingleton module ClassMethods def method_missing(meth, *args, &block) if self.instance && self.instance.respond_to?(meth) self.instance.__send__(meth, *args, &block) else super end end def respond_to?(meth) super(meth) || self.instance.respond_to?(meth) end end def self.included(base) base.__send__(:include, ::Singleton) unless base.ancestors.include?(::Singleton) base.__send__(:extend, ClassMethods) end end end
Version data entries
23 entries across 23 versions & 1 rubygems