diff --git a/src/abstract_negotiator.cr b/src/abstract_negotiator.cr index dd72401..0f67a51 100644 --- a/src/abstract_negotiator.cr +++ b/src/abstract_negotiator.cr @@ -9,7 +9,7 @@ abstract class Athena::Negotiation::AbstractNegotiator(HeaderType) end end - # Returns the best `HeaderType` type based on the provided *header* value and *priorities*. + # Returns the best `HeaderType` based on the provided *header* value and *priorities*. # # If *strict* is `true`, an `ANG::Exceptions::Exception` will be raised if the *header* contains an invalid value, otherwise it is ignored. # @@ -41,7 +41,7 @@ abstract class Athena::Negotiation::AbstractNegotiator(HeaderType) match.nil? ? nil : accepted_priorties[match.index] end - # Returns an array of `HeaderType` types that the provided *header* allows, ordered so that the `#best` match is first. + # Returns an array of `HeaderType` that the provided *header* allows, ordered so that the `#best` match is first. # # ``` # header = "text/*;q=0.3, text/html;q=0.7, text/html;level=1, text/html;level=2;q=0.4, */*;q=0.5" diff --git a/src/accept.cr b/src/accept.cr index 34d85ec..8a4b6df 100644 --- a/src/accept.cr +++ b/src/accept.cr @@ -5,7 +5,7 @@ require "./base_accept" # ``` # accept = ANG::Accept.new "application/json; q = 0.75; charset = UTF-8" # -# accept.header # => "application/json; q = 0.9; 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 diff --git a/src/accept_encoding.cr b/src/accept_encoding.cr index 5157935..138922e 100644 --- a/src/accept_encoding.cr +++ b/src/accept_encoding.cr @@ -5,8 +5,8 @@ require "./base_accept" # ``` # accept = ANG::AcceptEncoding.new "gzip; q = 0.5; key=value" # -# accept.header # => "gzip-1; q = 0.5; key=value" -# accept.normalized_header # => "gzip-1; key=value" +# accept.header # => "gzip; q = 0.5; key=value" +# accept.normalized_header # => "gzip; key=value" # accept.parameters # => {"key" => "value"} # accept.quality # => 0.5 # accept.coding # => "gzip" diff --git a/src/accept_language.cr b/src/accept_language.cr index b4c3115..f0a2ed6 100644 --- a/src/accept_language.cr +++ b/src/accept_language.cr @@ -19,11 +19,11 @@ struct Athena::Negotiation::AcceptLanguage < Athena::Negotiation::BaseAccept getter language : String # Returns the region, if any, for this `AcceptLanguage` header. - # E.x. if the `#language_range` is `zh-Hans-CN`, the language would be `cn` + # E.x. if the `#language_range` is `zh-Hans-CN`, the region would be `cn` getter region : String? = nil # Returns the script, if any, for this `AcceptLanguage` header. - # E.x. if the `#language_range` is `zh-Hans-CN`, the language would be `hans` + # E.x. if the `#language_range` is `zh-Hans-CN`, the script would be `hans` getter script : String? = nil def initialize(value : String) diff --git a/src/base_accept.cr b/src/base_accept.cr index fc9507d..f11d50e 100644 --- a/src/base_accept.cr +++ b/src/base_accept.cr @@ -1,7 +1,7 @@ # Base type for properties/logic all [Accept*](https://tools.ietf.org/html/rfc7231#section-5.3) headers share. abstract struct Athena::Negotiation::BaseAccept # Returns the full unaltered header `self` represents. - # E.x. `text/html` or `unicode-1-1;q=0.8` or `zh-Hans-CN`. + # E.x. `text/html`, `unicode-1-1;q=0.8`, or `zh-Hans-CN`. getter header : String # Returns a normalized version of the `#header`, excluding the `#quality` parameter.