Class: Kushojin::ControllerMethods::SendChangeCallback

Inherits:
Object
  • Object
show all
Defined in:
lib/kushojin/controller_methods/send_change_callback.rb

Instance Method Summary collapse

Constructor Details

#initialize(sender: nil) ⇒ SendChangeCallback

Returns a new instance of SendChangeCallback.



4
5
6
# File 'lib/kushojin/controller_methods/send_change_callback.rb', line 4

def initialize(sender: nil)
  @sender = sender || Config.sender
end

Instance Method Details

#around(controller) ⇒ Object



8
9
10
11
12
13
# File 'lib/kushojin/controller_methods/send_change_callback.rb', line 8

def around(controller)
  Recorder.build
  yield
  @sender.send(Recorder.changes, controller: controller)
  Recorder.destroy
end