Class: Recluse::Response
- Inherits:
-
Object
- Object
- Recluse::Response
- Defined in:
- lib/recluse/response.rb
Overview
Response wrapper.
Instance Attribute Summary collapse
-
#code ⇒ Object
StatusCode
of the response. -
#errors ⇒ Object
Error string if any.
-
#page ⇒ Object
Mechanize::Page
of the response page. -
#success ⇒ Object
Whether the page was successfully accessed or not.
Instance Method Summary collapse
-
#initialize(page: nil, errors: false, code: StatusCode.new('idk'), success: false) ⇒ Response
constructor
Create new response.
Constructor Details
#initialize(page: nil, errors: false, code: StatusCode.new('idk'), success: false) ⇒ Response
Create new response.
26 27 28 29 30 31 |
# File 'lib/recluse/response.rb', line 26 def initialize(page: nil, errors: false, code: StatusCode.new('idk'), success: false) @page = page @code = code @errors = errors @success = success end |
Instance Attribute Details
#code ⇒ Object
StatusCode
of the response.
14 15 16 |
# File 'lib/recluse/response.rb', line 14 def code @code end |
#errors ⇒ Object
Error string if any.
18 19 20 |
# File 'lib/recluse/response.rb', line 18 def errors @errors end |
#page ⇒ Object
Mechanize::Page
of the response page. Might be nil
.
10 11 12 |
# File 'lib/recluse/response.rb', line 10 def page @page end |
#success ⇒ Object
Whether the page was successfully accessed or not.
22 23 24 |
# File 'lib/recluse/response.rb', line 22 def success @success end |