Sha256: cd6cc85923dc87911b88ffef288d5993ccedfa547cfbf0289ea8a06a7fcb4f82

Contents?: true

Size: 535 Bytes

Versions: 9

Compression:

Stored size: 535 Bytes

Contents

require 'hyperion/headers'

class ResponseDescriptor
  # Describes properties of an acceptable response

  include Hyperion::Headers

  attr_reader :type, :version, :format

  # @param type [String]
  # @param version [Integer]
  # @param format [Symbol] :json
  def initialize(type, version, format)
    @type, @version, @format = type, version, format
  end

  def as_json(*_args)
    {
        'type' => type,
        'version' => version,
        'format' => format.to_s
    }
  end

  def to_s
    short_mimetype(self)
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
hyperion_http-0.6.0 lib/hyperion/types/response_descriptor.rb
hyperion_http-0.5.0 lib/hyperion/types/response_descriptor.rb
hyperion_http-0.3.0 lib/hyperion/types/response_descriptor.rb
hyperion_http-0.2.4 lib/hyperion/types/response_descriptor.rb
hyperion_http-0.2.3 lib/hyperion/types/response_descriptor.rb
hyperion_http-0.2.2 lib/hyperion/types/response_descriptor.rb
hyperion_http-0.2.1 lib/hyperion/types/response_descriptor.rb
hyperion_http-0.1.9 lib/hyperion/types/response_descriptor.rb
hyperion_http-0.1.8 lib/hyperion/types/response_descriptor.rb