From 4c2e6b96ef1a215c542a9cb1abdce5f9fcc5927c Mon Sep 17 00:00:00 2001 From: George Dietrich Date: Thu, 24 Dec 2020 10:16:50 -0500 Subject: [PATCH] Fix typo (#3) * Fix typo * Add note about strict arg --- src/abstract_negotiator.cr | 2 ++ src/athena-negotiation.cr | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/abstract_negotiator.cr b/src/abstract_negotiator.cr index 6c014e2..dd72401 100644 --- a/src/abstract_negotiator.cr +++ b/src/abstract_negotiator.cr @@ -11,6 +11,8 @@ abstract class Athena::Negotiation::AbstractNegotiator(HeaderType) # Returns the best `HeaderType` type 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. + # # See `Athena::Negotiation` for examples. def best(header : String, priorities : Indexable(String), strict : Bool = false) : HeaderType? raise ArgumentError.new "priorities should not be empty." if priorities.empty? diff --git a/src/athena-negotiation.cr b/src/athena-negotiation.cr index 1b36c62..f760d47 100644 --- a/src/athena-negotiation.cr +++ b/src/athena-negotiation.cr @@ -67,7 +67,7 @@ alias ANG = Athena::Negotiation # accept.coding # => "gzip" # ``` # -# The `ANG::EncodingNegotiator` type returns an `ANG::AcceptEncoding`, or `nil` if negotiating the best character set has failed. +# The `ANG::EncodingNegotiator` type returns an `ANG::AcceptEncoding`, or `nil` if negotiating the best encoding has failed. # # ### Language # @@ -84,7 +84,7 @@ alias ANG = Athena::Negotiation # accept.script # => "hans" # ``` # -# The `ANG::LanguageNegotiator` type returns an `ANG::AcceptLanguage`, or `nil` if negotiating the best character set has failed. +# The `ANG::LanguageNegotiator` type returns an `ANG::AcceptLanguage`, or `nil` if negotiating the best language has failed. module Athena::Negotiation # Returns a lazily initialized `ANG::Negotiator` singleton instance. class_getter(negotiator) { ANG::Negotiator.new }