Class: Mechanize::HTTP::AuthRealm

Inherits:
Object
  • Object
show all
Defined in:
lib/mechanize/http/auth_realm.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scheme, uri, realm) ⇒ AuthRealm

Returns a new instance of AuthRealm.



7
8
9
10
11
# File 'lib/mechanize/http/auth_realm.rb', line 7

def initialize scheme, uri, realm
  @scheme = scheme
  @uri    = uri
  @realm  = realm.downcase if realm
end

Instance Attribute Details

#realmObject (readonly)

Returns the value of attribute realm.



5
6
7
# File 'lib/mechanize/http/auth_realm.rb', line 5

def realm
  @realm
end

#schemeObject (readonly)

Returns the value of attribute scheme.



3
4
5
# File 'lib/mechanize/http/auth_realm.rb', line 3

def scheme
  @scheme
end

#uriObject (readonly)

Returns the value of attribute uri.



4
5
6
# File 'lib/mechanize/http/auth_realm.rb', line 4

def uri
  @uri
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



13
14
15
16
17
18
# File 'lib/mechanize/http/auth_realm.rb', line 13

def == other
  self.class === other and
    @scheme == other.scheme and
    @uri    == other.uri    and
    @realm  == other.realm
end

#hashObject

:nodoc:



22
23
24
# File 'lib/mechanize/http/auth_realm.rb', line 22

def hash # :nodoc:
  [@scheme, @uri, @realm].hash
end

#inspectObject

:nodoc:



26
27
28
# File 'lib/mechanize/http/auth_realm.rb', line 26

def inspect # :nodoc:
  "#<AuthRealm %s %p \"%s\">" % [@scheme, @uri, @realm]
end