Exception: Modern::Redirect

Inherits:
Exception
  • Object
show all
Defined in:
lib/modern/redirect.rb

Overview

rubocop:disable Lint/InheritException

Direct Known Subclasses

PermanentRedirect, TemporaryRedirect

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(redirect_to) ⇒ Redirect

Returns a new instance of Redirect.



8
9
10
11
# File 'lib/modern/redirect.rb', line 8

def initialize(redirect_to)
  raise "Redirects require a target." if redirect_to.nil?
  @redirect_to = redirect_to
end

Instance Attribute Details

#redirect_toObject (readonly)

Returns the value of attribute redirect_to.



6
7
8
# File 'lib/modern/redirect.rb', line 6

def redirect_to
  @redirect_to
end

Instance Method Details

#statusObject



13
14
15
# File 'lib/modern/redirect.rb', line 13

def status
  raise "#{self.class.name}#status must be implemented."
end