Module: Hanami::Action::Callbacks::ClassMethods Private

Defined in:
lib/idempotency/hanami/action/callbacks.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Callbacks API class methods

Since:

  • 0.1.0

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(base) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Override Ruby’s hook for modules. It includes callbacks logic

Parameters:

  • base (Class)

    the target action

See Also:

Since:

  • 0.1.0



48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/idempotency/hanami/action/callbacks.rb', line 48

def self.extended(base)
  base.class_eval do
    include Utils::ClassAttribute

    class_attribute :before_callbacks
    self.before_callbacks = Utils::Callbacks::Chain.new

    class_attribute :after_callbacks
    self.after_callbacks = Utils::Callbacks::Chain.new

    class_attribute :around_callbacks
    self.around_callbacks = Utils::Callbacks::Chain.new
  end
end

Instance Method Details

#append_after(*callbacks) ⇒ Object Also known as: after

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0



75
76
77
# File 'lib/idempotency/hanami/action/callbacks.rb', line 75

def append_after(*callbacks, &)
  after_callbacks.append(*callbacks, &)
end

#append_aroundObject Also known as: around

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0



63
64
65
# File 'lib/idempotency/hanami/action/callbacks.rb', line 63

def append_around(&)
  around_callbacks.append_around(&)
end

#append_before(*callbacks) ⇒ Object Also known as: before

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0



69
70
71
# File 'lib/idempotency/hanami/action/callbacks.rb', line 69

def append_before(*callbacks, &)
  before_callbacks.append(*callbacks, &)
end

#prepend_after(*callbacks) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0



85
86
87
# File 'lib/idempotency/hanami/action/callbacks.rb', line 85

def prepend_after(*callbacks, &)
  after_callbacks.prepend(*callbacks, &)
end

#prepend_before(*callbacks) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0



81
82
83
# File 'lib/idempotency/hanami/action/callbacks.rb', line 81

def prepend_before(*callbacks, &)
  before_callbacks.prepend(*callbacks, &)
end