# frozen_string_literal: true module PresenceBangExtension class BlankObjectError < StandardError end end Object.class_eval do unless method_defined?(:presence!) # Returns self if `present?` # # @raise [BlankObject] if `blank?` # # @return [*] # def presence! raise(PresenceBangExtension::BlankObjectError, 'Blank object') if blank? self end end end