module Frubby::RespondToMissing

Constants

EXCLUDED_RESPOND_TOS
KERNEL_METHODS

Public Instance Methods

respond_to_missing?(method_name, include_private = false) click to toggle source
Calls superclass method
# File lib/frubby/respond_to_missing.rb, line 16
def respond_to_missing?(method_name, include_private = false)
  return super if EXCLUDED_RESPOND_TOS.include? method_name.to_sym

  _methods = KERNEL_METHODS + methods
  _method = FuzzyMatch.new(_methods).find(method_name.to_sym)
  
  warn "[frubby] respond_to_missing: #{method_name} ~> #{_method}" if $DEBUG

  _method.is_a?(Symbol) ? true : super
end