Sha256: 33af829888f29570c1c9493e75f7ed52a46c88d48572bf4b15116fe4e66dcbef
Contents?: true
Size: 506 Bytes
Versions: 6
Compression:
Stored size: 506 Bytes
Contents
# frozen_string_literal: true Range.class_eval do unless method_defined?(:zero?) # Checks if the whole range is zero. # # @raise [RubyRailsExtensions::Errors::NonNumericError] # # @return [Boolean] # def zero? unless self.begin.is_a?(Numeric) raise( RubyRailsExtensions::Errors::NonNumericError, "Wrong range type (given #{self.begin.class}, expected Numeric)" ) end self.begin.zero? && self.end.zero? end end end
Version data entries
6 entries across 6 versions & 1 rubygems