Class: SoarScRouting::BaseRouter

Inherits:
Object
  • Object
show all
Defined in:
lib/soar_sc_routing/base_router.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(route_meta) ⇒ BaseRouter

Returns a new instance of BaseRouter.



7
8
9
# File 'lib/soar_sc_routing/base_router.rb', line 7

def initialize(route_meta)
  @route_meta = route_meta
end

Instance Attribute Details

#route_metaObject (readonly)

Returns the value of attribute route_meta.



5
6
7
# File 'lib/soar_sc_routing/base_router.rb', line 5

def route_meta
  @route_meta
end

Instance Method Details

#redirect_to(url, http_code = 302) ⇒ Object



18
19
20
# File 'lib/soar_sc_routing/base_router.rb', line 18

def redirect_to(url, http_code = 302)
  [http_code, {'Location' => url, 'Content-Type' => 'text/html', 'Content-Length' => '0'}, []]
end

#route(request) ⇒ Object



11
12
13
14
15
16
# File 'lib/soar_sc_routing/base_router.rb', line 11

def route(request)
  route_path(request)

rescue => ex
  excepted(ex)
end