Files

Tins::SexySingleton

Public Class Methods

__old_singleton_included__(klass) click to toggle source
Alias for: included
included(klass) click to toggle source
# File lib/tins/sexy_singleton.rb, line 15
def included(klass)
  __old_singleton_included__(klass)
  (class << klass; self; end).class_eval do
    if Object.method_defined?(:respond_to_missing?)
      def  respond_to_missing?(name, *args)
        instance.respond_to?(name) || super
      end
    else
      def respond_to?(name, *args)
        instance.respond_to?(name) || super
      end
    end

    def method_missing(name, *args, &block)
      if instance.respond_to?(name)
        instance.__send__(name, *args, &block)
      else
        super
      end
    end
  end
  super
end
Also aliased as: __old_singleton_included__
method_missing(name, *args, &block) click to toggle source
# File lib/tins/sexy_singleton.rb, line 28
def method_missing(name, *args, &block)
  if instance.respond_to?(name)
    instance.__send__(name, *args, &block)
  else
    super
  end
end
respond_to?(name, *args) click to toggle source
# File lib/tins/sexy_singleton.rb, line 23
def respond_to?(name, *args)
  instance.respond_to?(name) || super
end
respond_to_missing?(name, *args) click to toggle source
# File lib/tins/sexy_singleton.rb, line 19
def  respond_to_missing?(name, *args)
  instance.respond_to?(name) || super
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.