Fix typo (#3)

* Fix typo
* Add note about strict arg
This commit is contained in:
George Dietrich 2020-12-24 10:16:50 -05:00 committed by GitHub
parent 96fe9291e3
commit 4c2e6b96ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -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?

View file

@ -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 }