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.



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

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

Instance Attribute Details

#realmObject (readonly)

Returns the value of attribute realm.



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

def realm
  @realm
end

#schemeObject (readonly)

Returns the value of attribute scheme.



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

def scheme
  @scheme
end

#uriObject (readonly)

Returns the value of attribute uri.



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

def uri
  @uri
end

Instance Method Details

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



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

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

#hashObject

:nodoc:



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

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

#inspectObject

:nodoc:



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

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