Module: Trailblazer::V1_1::Operation::Callback::ClassMethods

Defined in:
lib/trailblazer/1.1/operation/callback.rb

Instance Method Summary collapse

Instance Method Details

#callback(name = :default, constant = nil, &block) ⇒ Object


35
36
37
38
39
# File 'lib/trailblazer/1.1/operation/callback.rb', line 35

def callback(name=:default, constant=nil, &block)
  return callbacks[name][:group] unless constant or block_given?

  add_callback(name, constant, &block)
end

#callbacksObject


31
32
33
# File 'lib/trailblazer/1.1/operation/callback.rb', line 31

def callbacks
  @callbacks ||= {}
end