module Protocol::Utilities
A module for some Utility methods.
Public Instance Methods
find_method_module(methodname, ancestors)
click to toggle source
This Method tries to find the first module that implements the method named methodname
in the array of ancestors
. If this fails nil is returned.
# File lib/protocol/utilities.rb, line 9 def find_method_module(methodname, ancestors) methodname = methodname.to_s ancestors.each do |a| begin a.instance_method(methodname) return a rescue NameError end end nil end