Sha256: 57b74b2f51ed62c6318512f6040a758afcc9388791d5b495e9090134d5f0ef3f
Contents?: true
Size: 641 Bytes
Versions: 10
Compression:
Stored size: 641 Bytes
Contents
# frozen_string_literal: true require 'delegate' module MediaTypes class Scheme class CaseEqualityWithNil < SimpleDelegator # Same as the wrapped {Object#===}, but also allows for NilCLass def ===(other) other.nil? || super end end # noinspection RubyInstanceMethodNamingConvention ## # Allows the wrapped +klazz+ to be nil # # @param [Class] klazz the class that +it+ must be the if +it+ is not NilClass # @return [CaseEqualityWithNil] def AllowNil(klazz) # rubocop:disable Naming/MethodName CaseEqualityWithNil.new(klazz) end end end
Version data entries
10 entries across 10 versions & 1 rubygems