Sha256: 132d992f118f1c666350573d0e15c78f2be01be2438f532ead65ac0ccf206973

Contents?: true

Size: 597 Bytes

Versions: 1

Compression:

Stored size: 597 Bytes

Contents

# frozen_string_literal: true

module MediaTypes
  class Object < SimpleDelegator
    def class
      __getobj__.class
    end

    def ===(other)
      __getobj__ === other # rubocop:disable Style/CaseEquality
    end

    def blank?
      if __getobj__.respond_to?(:blank?)
        return __getobj__.blank?
      end

      if __getobj__.respond_to?(:empty?)
        return __getobj__.empty?
      end

      if __getobj__.respond_to?(:length)
        return __getobj__.length.zero?
      end

      !__getobj__
    end

    alias empty? blank?

    def present?
      !blank?
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
media_types-2.3.0 lib/media_types/object.rb