Sha256: c0a470879ebfc4e03f759912c66f8ac6ae9299762d17c17a3151fdd4a94b0e54

Contents?: true

Size: 517 Bytes

Versions: 6

Compression:

Stored size: 517 Bytes

Contents

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

6 entries across 6 versions & 1 rubygems

Version Path
http-0.6.4 lib/http/mime_type/adapter.rb
http-0.6.3 lib/http/mime_type/adapter.rb
http-0.6.2 lib/http/mime_type/adapter.rb
http-0.6.1 lib/http/mime_type/adapter.rb
http-0.6.0 lib/http/mime_type/adapter.rb
http-0.6.0.pre lib/http/mime_type/adapter.rb