Module: RightSupport::Ruby::EasySingleton::ClassMethods

Defined in:
lib/right_support/ruby/easy_singleton.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args, &block) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/right_support/ruby/easy_singleton.rb', line 6

def method_missing(meth, *args, &block)
  if self.instance && self.instance.respond_to?(meth)
    self.instance.__send__(meth, *args, &block)
  else
    super
  end
end

Instance Method Details

#respond_to?(meth) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/right_support/ruby/easy_singleton.rb', line 14

def respond_to?(meth)
  super(meth) || self.instance.respond_to?(meth)
end