Class: Grell::Page::ErroredPage
- Inherits:
-
Object
- Object
- Grell::Page::ErroredPage
- Defined in:
- lib/grell/page.rb
Overview
Private class. This is a result page when some error happened. It provides some information about the error.
Instance Method Summary collapse
- #body ⇒ Object
- #has_selector?(selector) ⇒ Boolean
- #headers ⇒ Object
- #host ⇒ Object
-
#initialize(error_code, exception) ⇒ ErroredPage
constructor
A new instance of ErroredPage.
- #links ⇒ Object
- #status ⇒ Object
- #visited? ⇒ Boolean
Constructor Details
#initialize(error_code, exception) ⇒ ErroredPage
Returns a new instance of ErroredPage.
116 117 118 119 |
# File 'lib/grell/page.rb', line 116 def initialize(error_code, exception) @error_code = error_code @exception = exception end |
Instance Method Details
#body ⇒ Object
125 126 127 |
# File 'lib/grell/page.rb', line 125 def body '' end |
#has_selector?(selector) ⇒ Boolean
155 156 157 |
# File 'lib/grell/page.rb', line 155 def has_selector?(selector) false end |
#headers ⇒ Object
129 130 131 132 133 134 135 136 137 138 139 140 141 |
# File 'lib/grell/page.rb', line 129 def headers = begin @exception. rescue StandardError "Error message can not be accessed" #Poltergeist may try to access a nil object when accessing message end { grellStatus: 'Error', errorClass: @exception.class.to_s, errorMessage: } end |
#host ⇒ Object
147 148 149 |
# File 'lib/grell/page.rb', line 147 def host '' end |
#links ⇒ Object
143 144 145 |
# File 'lib/grell/page.rb', line 143 def links [] end |
#status ⇒ Object
121 122 123 |
# File 'lib/grell/page.rb', line 121 def status @error_code end |
#visited? ⇒ Boolean
151 152 153 |
# File 'lib/grell/page.rb', line 151 def visited? true end |