# frozen_string_literal: true require 'forwardable' require 'set' Array.class_eval do unless method_defined?(:find!) # :nodoc: def find!(&block) x = find(&block) raise(RubyRailsExtensions::Errors::NotFoundError, 'Not found') if x.nil? x end end end Set.class_eval do unless method_defined?(:find!) extend Forwardable def_delegators :to_a, :find! end end