lib/rubocop/cop/solidus/reimbursement_hook_deprecated.rb in rubocop-solidus-0.1.3 vs lib/rubocop/cop/solidus/reimbursement_hook_deprecated.rb in rubocop-solidus-0.1.4
- old
+ new
@@ -3,9 +3,26 @@
module RuboCop
module Cop
module Solidus
# This cop finds reimbursement_success_hooks and reimbursement_failed_hooks calls and
# asks to remove them and subscribe to reimbursement_reimbursed event instead.
+ #
+ # @example
+ #
+ # # bad
+ # reimbursement_success_hooks.each { |h| h.call self }
+ # reimbursement_failed_hooks.each { |h| h.call self }
+ #
+ # # good
+ #
+ # @example
+ #
+ # # bad
+ # reimbursement_success_hooks.any?
+ # reimbursement_failed_hooks.any?
+ #
+ # # good
+ #
class ReimbursementHookDeprecated < Base
include TargetSolidusVersion
minimum_solidus_version 2.11
MSG = 'Please remove reimbursement_success_hooks and reimbursement_failed_hooks. ' \