Sha256: b9c847fe309e0bbc01a1645499c484eec642e6bc655a278b2fc1fa94b1f1c55f

Contents?: true

Size: 548 Bytes

Versions: 19

Compression:

Stored size: 548 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

      %w[encode decode].each do |operation|
        class_eval <<-RUBY, __FILE__, __LINE__
          def #{operation}(*)
            fail Error, "\#{self.class} does not supports ##{operation}"
          end
        RUBY
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
http-4.4.1 lib/http/mime_type/adapter.rb
http-4.4.0 lib/http/mime_type/adapter.rb
http-4.3.0 lib/http/mime_type/adapter.rb
http-4.2.0 lib/http/mime_type/adapter.rb
http-4.1.1 lib/http/mime_type/adapter.rb
http-4.1.0 lib/http/mime_type/adapter.rb
http-4.0.5 lib/http/mime_type/adapter.rb
http-4.0.4 lib/http/mime_type/adapter.rb
http-5.0.0.pre lib/http/mime_type/adapter.rb
http-4.0.3 lib/http/mime_type/adapter.rb
http-4.0.2 lib/http/mime_type/adapter.rb
http-4.0.1 lib/http/mime_type/adapter.rb
http-4.0.0 lib/http/mime_type/adapter.rb
http-3.3.0 lib/http/mime_type/adapter.rb
http-3.2.1 lib/http/mime_type/adapter.rb
http-3.2.0 lib/http/mime_type/adapter.rb
http-3.1.0 lib/http/mime_type/adapter.rb
http-3.0.0 lib/http/mime_type/adapter.rb
http-3.0.0.pre lib/http/mime_type/adapter.rb