File: auth_realm.rb

package info (click to toggle)
ruby-mechanize 2.14.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,516 kB
  • sloc: ruby: 11,754; makefile: 7; sh: 2
file content (32 lines) | stat: -rw-r--r-- 558 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# frozen_string_literal: true
class Mechanize::HTTP::AuthRealm

  attr_reader :scheme
  attr_reader :uri
  attr_reader :realm

  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

  alias eql? ==

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

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

end