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.
5 6 7 8 |
# File 'lib/mechanize/unauthorized_error.rb', line 5 def initialize page, challenges, super page, @challenges = challenges end |
Instance Attribute Details
#challenges ⇒ Object (readonly)
Returns the value of attribute challenges.
3 4 5 |
# File 'lib/mechanize/unauthorized_error.rb', line 3 def challenges @challenges end |
Instance Method Details
#to_s ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/mechanize/unauthorized_error.rb', line 10 def to_s out = super if @challenges then realms = @challenges.map { |challenge| challenge.realm_name }.join ', ' out << " -- available realms: #{realms}" end out end |