lib/hanami/interactor.rb in hanami-utils-0.9.1 vs lib/hanami/interactor.rb in hanami-utils-0.9.2
- old
+ new
@@ -1,8 +1,9 @@
require 'hanami/utils/basic_object'
require 'hanami/utils/class_attribute'
require 'hanami/utils/hash'
+require 'hanami/utils/deprecation'
module Hanami
# Hanami Interactor
#
# @since 0.3.5
@@ -18,10 +19,11 @@
#
# @see Hanami::Interactor::Result#respond_to_missing?
METHODS = ::Hash[initialize: true,
success?: true,
successful?: true,
+ failure?: true,
failing?: true,
fail!: true,
prepare!: true,
errors: true,
error: true].freeze
@@ -54,11 +56,23 @@
# Check if the current status is not successful
#
# @return [TrueClass,FalseClass] the result of the check
#
- # @since 0.8.1
+ # @since 0.9.2
+ #
+ # @deprecated Use {#failure?} instead
def failing?
+ Utils::Deprecation.new("`Hanami::Interactor::Result#failing?' is deprecated, please use `Hanami::Interactor::Result#failure?'")
+ failure?
+ end
+
+ # Check if the current status is not successful
+ #
+ # @return [TrueClass,FalseClass] the result of the check
+ #
+ # @since 0.9.2
+ def failure?
!successful?
end
# Force the status to be a failure
#