Method: Module#instance_method_defined?

Defined in:
lib/core/facets/module/instance_method_defined.rb

#instance_method_defined?(meth) ⇒ Boolean

Query whether a public instance method is defined for the module.

CREDIT: Gavin Sinclair, Noah Gibbs

Returns:

  • (Boolean)


7
8
9
# File 'lib/core/facets/module/instance_method_defined.rb', line 7

def instance_method_defined?(meth)
  instance_methods(true).find{ |m| m.to_sym == meth.to_sym }
end