struct Athena::Negotiation::Accept
- Athena::Negotiation::Accept
- Athena::Negotiation::BaseAccept
- Struct
- Value
- Object
Overview
Represents an Accept header media type.
accept = ANG::Accept.new "application/json; q = 0.75; charset = UTF-8"
accept.header # => "application/json; q = 0.75; charset = UTF-8"
accept.normalized_header # => "application/json; charset=UTF-8"
accept.parameters # => {"charset" => "UTF-8"}
accept.quality # => 0.75
accept.type # => "application"
accept.sub_type # => "json"
Defined in:
accept.crConstructors
Instance Method Summary
-
#media_range : String
Returns the media range this
Accept
header represents. -
#sub_type : String
Returns the sub type for this
Accept
header. -
#type : String
Returns the type for this
Accept
header.
Instance methods inherited from struct Athena::Negotiation::BaseAccept
header : String
header,
normalized_header : String
normalized_header,
parameters : Hash(String, String)
parameters,
quality : Float32
quality
Constructor methods inherited from struct Athena::Negotiation::BaseAccept
new(header : String)
new
Constructor Detail
Instance Method Detail
def media_range : String
#
Returns the media range this Accept
header represents.
I.e. #header
minus the #quality
and #parameters
.
def sub_type : String
#
Returns the sub type for this Accept
header.
E.x. if the #media_range
is application/json
, the sub type would be json
.
def type : String
#
Returns the type for this Accept
header.
E.x. if the #media_range
is application/json
, the type would be application
.