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