Exception: Mechanize::UnauthorizedError
- Inherits:
-
ResponseCodeError
- Object
- RuntimeError
- Error
- ResponseCodeError
- Mechanize::UnauthorizedError
- Defined in:
- lib/mechanize/unauthorized_error.rb
Instance Attribute Summary collapse
-
#challenges ⇒ Object
readonly
Returns the value of attribute challenges.
Attributes inherited from ResponseCodeError
Instance Method Summary collapse
-
#initialize(page, challenges, message) ⇒ UnauthorizedError
constructor
A new instance of UnauthorizedError.
- #to_s ⇒ Object
Constructor Details
#initialize(page, challenges, message) ⇒ UnauthorizedError
Returns a new instance of UnauthorizedError.
6 7 8 9 |
# File 'lib/mechanize/unauthorized_error.rb', line 6 def initialize page, challenges, super page, @challenges = challenges end |
Instance Attribute Details
#challenges ⇒ Object (readonly)
Returns the value of attribute challenges.
4 5 6 |
# File 'lib/mechanize/unauthorized_error.rb', line 4 def challenges @challenges end |
Instance Method Details
#to_s ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/mechanize/unauthorized_error.rb', line 11 def to_s out = super if @challenges then realms = @challenges.map(&:realm_name).join ', ' out << " -- available realms: #{realms}" end out end |