Module: Kernel
- Defined in:
- lib/method_matching.rb
Defined Under Namespace
Modules: MethodMissingDefinition
Instance Method Summary
collapse
Instance Method Details
#method_matchers ⇒ Object
14
15
16
|
# File 'lib/method_matching.rb', line 14
def method_matchers
@method_matchers ||= { }
end
|
#method_matching(regex, &definition) ⇒ Object
6
7
8
9
10
11
12
|
# File 'lib/method_matching.rb', line 6
def method_matching(regex, &definition)
method_matchers[regex] = MethodMatching::ExtendableBlock.new &definition
klass = private_methods.include?("include") ? self : (class << self; self; end)
klass.class_eval do
include MethodMissingDefinition unless included_modules.include?(MethodMissingDefinition)
end
end
|