add auth realm

master
Kanezoh 2021-11-27 00:57:02 +09:00
parent 37300e116e
commit 972fc61ad7
1 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,27 @@
# This class represents realm attribute of www-authenticate header.
class Mechanize::HTTP::AuthRealm
getter scheme : String
getter uri : URI
getter realm : String
def initialize(scheme, uri, realm)
@scheme = scheme
@uri = uri
@realm = realm if realm
end
def ==(other)
self.class === other and
@scheme == other.scheme and
@uri == other.uri and
@realm == other.realm
end
def hash # :nodoc:
[@scheme, @uri, @realm].hash
end
def inspect # :nodoc:
"#<AuthRealm %s %p \"%s\">" % [@scheme, @uri, @realm]
end
end