Sha256: 26234bfb39a02e9d6a013b34e1928b537d43bae911c2b0f1ea39c67e83e7c631

Contents?: true

Size: 860 Bytes

Versions: 14

Compression:

Stored size: 860 Bytes

Contents

# frozen_string_literal: true

require 'delegate'
require 'media_types/scheme/any_of'

module MediaTypes
  class Scheme
    class << self
      # noinspection RubyClassMethodNamingConvention
      ##
      # Allows the wrapped +klazz+ to be nil
      #
      # @param [Class] klazz the class that +it+ must be the if +it+ is not NilClass
      # @return [CaseEqualityWithList]
      def AllowNil(klazz) # rubocop:disable Naming/MethodName
        AnyOf(NilClass, klazz)
      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 [CaseEqualityWithList]
    def AllowNil(klazz) # rubocop:disable Naming/MethodName
      self.class.AllowNil(klazz)
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
media_types-2.3.2 lib/media_types/scheme/allow_nil.rb
media_types-2.2.0 lib/media_types/scheme/allow_nil.rb
media_types-2.1.1 lib/media_types/scheme/allow_nil.rb
media_types-2.1.0 lib/media_types/scheme/allow_nil.rb
media_types-2.0.1 lib/media_types/scheme/allow_nil.rb
media_types-2.0.0 lib/media_types/scheme/allow_nil.rb
media_types-1.0.0 lib/media_types/scheme/allow_nil.rb
media_types-0.6.2 lib/media_types/scheme/allow_nil.rb
media_types-0.6.1 lib/media_types/scheme/allow_nil.rb
media_types-0.6.0 lib/media_types/scheme/allow_nil.rb
media_types-0.5.5 lib/media_types/scheme/allow_nil.rb
media_types-0.5.4 lib/media_types/scheme/allow_nil.rb
media_types-0.5.3 lib/media_types/scheme/allow_nil.rb
media_types-0.5.2 lib/media_types/scheme/allow_nil.rb