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



28
29
30
31
32
33
34
# File 'lib/right_support/ruby/easy_singleton.rb', line 28

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)


36
37
38
# File 'lib/right_support/ruby/easy_singleton.rb', line 36

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