Module: Landable::Page::Errors

Extended by:
ActiveSupport::Concern
Included in:
Landable::Page
Defined in:
app/models/landable/page.rb

Defined Under Namespace

Classes: GoneError

Instance Method Summary collapse

Instance Method Details

#errorObject



261
262
263
264
265
266
267
268
269
270
# File 'app/models/landable/page.rb', line 261

def error
  return nil unless error?

  case status_code
  when 410
    GoneError.new
  else
    Landable::Error.new "Missing a Page error class for #{status_code}"
  end
end

#error?Boolean

Returns:

  • (Boolean)


257
258
259
# File 'app/models/landable/page.rb', line 257

def error?
  (400..599).cover? status_code
end