Class: Zypper::Upgraderepo::PageRequest
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Zypper::Upgraderepo::PageRequest
- Defined in:
- lib/zypper/upgraderepo/requests/http.rb
Overview
Base class for a Web page request.
Direct Known Subclasses
Constant Summary collapse
- USER_AGENT =
"Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0"
Instance Attribute Summary collapse
-
#page ⇒ Object
readonly
Returns the value of attribute page.
Instance Method Summary collapse
- #available? ⇒ Boolean
- #cache! ⇒ Object
- #forbidden? ⇒ Boolean
-
#initialize(obj, timeout = 60) ⇒ PageRequest
constructor
A new instance of PageRequest.
- #not_found? ⇒ Boolean
- #redirected? ⇒ Boolean
- #redirected_to ⇒ Object
- #status ⇒ Object
- #timeout? ⇒ Boolean
Constructor Details
#initialize(obj, timeout = 60) ⇒ PageRequest
Returns a new instance of PageRequest.
16 17 18 19 |
# File 'lib/zypper/upgraderepo/requests/http.rb', line 16 def initialize(obj, timeout = 60) super obj @timeout = timeout end |
Instance Attribute Details
#page ⇒ Object (readonly)
Returns the value of attribute page.
12 13 14 |
# File 'lib/zypper/upgraderepo/requests/http.rb', line 12 def page @page end |
Instance Method Details
#available? ⇒ Boolean
21 22 23 |
# File 'lib/zypper/upgraderepo/requests/http.rb', line 21 def available? ping.is_a?(Net::HTTPSuccess) end |
#cache! ⇒ Object
49 50 51 |
# File 'lib/zypper/upgraderepo/requests/http.rb', line 49 def cache! @page = nil end |
#forbidden? ⇒ Boolean
37 38 39 |
# File 'lib/zypper/upgraderepo/requests/http.rb', line 37 def forbidden? ping.is_a?(Net::HTTPForbidden) end |
#not_found? ⇒ Boolean
33 34 35 |
# File 'lib/zypper/upgraderepo/requests/http.rb', line 33 def not_found? ping.is_a?(Net::HTTPNotFound) end |
#redirected? ⇒ Boolean
25 26 27 |
# File 'lib/zypper/upgraderepo/requests/http.rb', line 25 def redirected? ping.is_a?(Net::HTTPRedirection) end |
#redirected_to ⇒ Object
29 30 31 |
# File 'lib/zypper/upgraderepo/requests/http.rb', line 29 def redirected_to ping["location"] end |
#status ⇒ Object
45 46 47 |
# File 'lib/zypper/upgraderepo/requests/http.rb', line 45 def status ping.class.to_s end |
#timeout? ⇒ Boolean
41 42 43 |
# File 'lib/zypper/upgraderepo/requests/http.rb', line 41 def timeout? ping.is_a?(Net::HTTPRequestTimeOut) end |