Sha256: b9e8128eb816d559084875704e5addeb2cf74a0a130c4d61dceaa86c706ef87e

Contents?: true

Size: 671 Bytes

Versions: 15

Compression:

Stored size: 671 Bytes

Contents

# frozen_string_literal: true

require "forwardable"
require "singleton"

module HTTP
  module MimeType
    # Base encode/decode MIME type adapter
    class Adapter
      include Singleton

      class << self
        extend Forwardable
        def_delegators :instance, :encode, :decode
      end

      # rubocop:disable Style/DocumentDynamicEvalDefinition
      %w[encode decode].each do |operation|
        class_eval <<-RUBY, __FILE__, __LINE__ + 1
          def #{operation}(*)
            fail Error, "\#{self.class} does not supports ##{operation}"
          end
        RUBY
      end
      # rubocop:enable Style/DocumentDynamicEvalDefinition
    end
  end
end

Version data entries

15 entries across 15 versions & 3 rubygems

Version Path
direct7-0.0.18 vendor/bundle/ruby/2.7.0/gems/http-5.1.1/lib/http/mime_type/adapter.rb
direct7-0.0.17 vendor/bundle/ruby/2.7.0/gems/http-5.1.1/lib/http/mime_type/adapter.rb
direct7-0.0.16 vendor/bundle/ruby/2.7.0/gems/http-5.1.1/lib/http/mime_type/adapter.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/http-5.2.0/lib/http/mime_type/adapter.rb
direct7-0.0.13 vendor/bundle/ruby/2.7.0/gems/http-5.1.1/lib/http/mime_type/adapter.rb
direct7-0.0.12 vendor/bundle/ruby/2.7.0/gems/http-5.1.1/lib/http/mime_type/adapter.rb
http-5.2.0 lib/http/mime_type/adapter.rb
direct7-0.0.11 vendor/bundle/ruby/2.7.0/gems/http-5.1.1/lib/http/mime_type/adapter.rb
http-5.1.1 lib/http/mime_type/adapter.rb
http-5.1.0 lib/http/mime_type/adapter.rb
http-5.0.4 lib/http/mime_type/adapter.rb
http-5.0.3 lib/http/mime_type/adapter.rb
http-5.0.2 lib/http/mime_type/adapter.rb
http-5.0.1 lib/http/mime_type/adapter.rb
http-5.0.0 lib/http/mime_type/adapter.rb