Class: Recluse::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/recluse/response.rb

Overview

Response wrapper.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#codeObject

StatusCode of the response.



14
15
16
# File 'lib/recluse/response.rb', line 14

def code
  @code
end

#errorsObject

Error string if any.



18
19
20
# File 'lib/recluse/response.rb', line 18

def errors
  @errors
end

#pageObject

Mechanize::Page of the response page. Might be nil.



10
11
12
# File 'lib/recluse/response.rb', line 10

def page
  @page
end

#successObject

Whether the page was successfully accessed or not.



22
23
24
# File 'lib/recluse/response.rb', line 22

def success
  @success
end