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.
118 119 120 121 |
# File 'lib/grell/page.rb', line 118 def initialize(error_code, exception) @error_code = error_code @exception = exception end |
Instance Method Details
#body ⇒ Object
127 128 129 |
# File 'lib/grell/page.rb', line 127 def body '' end |
#has_selector?(selector) ⇒ Boolean
157 158 159 |
# File 'lib/grell/page.rb', line 157 def has_selector?(selector) false end |
#headers ⇒ Object
131 132 133 134 135 136 137 138 139 140 141 142 143 |
# File 'lib/grell/page.rb', line 131 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
149 150 151 |
# File 'lib/grell/page.rb', line 149 def host '' end |
#links ⇒ Object
145 146 147 |
# File 'lib/grell/page.rb', line 145 def links [] end |
#status ⇒ Object
123 124 125 |
# File 'lib/grell/page.rb', line 123 def status @error_code end |
#visited? ⇒ Boolean
153 154 155 |
# File 'lib/grell/page.rb', line 153 def visited? true end |