lib/verifly/dependent_callbacks.rb
def export_callbacks_to(target, groups: nil)
      (groups || dependent_callbacks_service.group_names).each do |group|
        case target
        when :active_support then _export_callback_group_to_active_support(group)
        when :action_controller then _export_callback_group_to_action_controller(group)
        when :wrap_method then _export_callback_group_to_method_wapper(group)
        else
          raise "#{target.inspect} export target unavailable. " \
                "available targets are :active_support, :action_controller, :wrap_method"
        end
      end
    end
# Exports callbacks to another callback system / something like that
# @param [:active_support, :wrap_method] target
#   Target selection.
#   * :active_support exports each group to correspoding
#     ActiveSupport callback (via set_callback)
#   * :wrap_method defines / redefines methods, named same as each group.
#     If method was defined, on it's call callbacks would run around its previous defenition.
#     If not, callbacks would run around nothing
# @param groups [[Symbol]] arra of groups to export. Defaults to all groups
Exports callbacks to another callback system / something like that
Exports callbacks to another callback system / something like that
def export_callbacks_to(target, groups: nil)
      (groups || dependent_callbacks_service.group_names).each do |group|
        case target
        when :active_support then _export_callback_group_to_active_support(group)
        when :action_controller then _export_callback_group_to_action_controller(group)
        when :wrap_method then _export_callback_group_to_method_wapper(group)
        else
          raise "#{target.inspect} export target unavailable. " \
                "available targets are :active_support, :action_controller, :wrap_method"
        end
      end
    end
def export_callbacks_to ( target , groups : nil ) ( groups || dependent_callbacks_service . group_names ) . each do | group | case target when :active_support then _export_callback_group_to_active_support ( group ) when :action_controller then _export_callback_group_to_action_controller ( group ) when :wrap_method then _export_callback_group_to_method_wapper ( group ) else raise "#{target.inspect} export target unavailable. " "available targets are :active_support, :action_controller, :wrap_method" end end end
Exports callbacks to another callback system / something like that
Exports callbacks to another callback system / something like that
target
groups
] arra of groups to export. Defaults to all groups
] arra of groups to export . Defaults to all groups
target Target selection. * :active_support exports each group to correspoding ActiveSupport callback (via set_callback) * :wrap_method defines / redefines methods, named same as each group. If method was defined, on it's call callbacks would run around its previous defenition. If not, callbacks would run around nothing
target Target selection . * : active_support exports each group to correspoding ActiveSupport callback ( via set_callback ) * : wrap_method defines / redefines methods named same as each group . If method was defined on it ' s call callbacks would run around its previous defenition . If not callbacks would run around nothing