Sha256: 87b84d09d7c051dcd2a5ba380fb19a35074ac2f4374014e8fda28c28f02da9da
Contents?: true
Size: 567 Bytes
Versions: 19
Compression:
Stored size: 567 Bytes
Contents
require 'singleton' module RightSupport::Ruby module EasySingleton module ClassMethods def method_missing(meth, *args) if self.instance && self.instance.respond_to?(meth) self.instance.__send__(meth, *args) 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
19 entries across 19 versions & 1 rubygems