Module: OverloadedMethods

Defined in:
lib/overloaded_methods.rb,
lib/overloaded_methods/version.rb

Defined Under Namespace

Classes: Clause, FunctionDefinition

Constant Summary collapse

VERSION =
"3.2.7"

Instance Method Summary collapse

Instance Method Details

#overload_method(name) {|collector| ... } ⇒ Object

Yields:

  • (collector)

5
6
7
8
9
10
11
# File 'lib/overloaded_methods.rb', line 5

def overload_method name
  collector = FunctionDefinition.new
  yield collector
  define_method name do |*params|
    collector.execute params
  end
end