Class: HangingMethods::MethodCallNotifier

Inherits:
Object
  • Object
show all
Defined in:
lib/hanging_methods/method_call_notifier.rb

Instance Method Summary collapse

Constructor Details

#initialize(&callback) ⇒ MethodCallNotifier

Returns a new instance of MethodCallNotifier.



3
4
5
# File 'lib/hanging_methods/method_call_notifier.rb', line 3

def initialize(&callback)
  @callback = callback
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *arguments, &block) ⇒ Object



7
8
9
# File 'lib/hanging_methods/method_call_notifier.rb', line 7

def method_missing(name, *arguments, &block)
  @callback.call(name, *arguments)
end