Class: Tzispa::Engine::Rig::Router
Constant Summary
Constants inherited
from RouteSet
RouteSet::CONTROLLERS_BASE
Instance Attribute Summary
Attributes inherited from RouteSet
#app, #map_path, #router
Instance Method Summary
collapse
-
#api(path, controller: nil, methods: nil) ⇒ Object
-
#index(path, controller: nil, methods: nil) ⇒ Object
-
#initialize(app, root = nil) ⇒ Router
constructor
A new instance of Router.
-
#layout(layout, path, controller: nil, methods: nil) ⇒ Object
-
#signed_api(path, controller: nil, methods: nil) ⇒ Object
Methods inherited from RouteSet
#add, #call, #draw, #path, #routes_definitions, #setup
Constructor Details
#initialize(app, root = nil) ⇒ Router
Returns a new instance of Router.
10
11
12
|
# File 'lib/tzispa/engine/rig/router.rb', line 10
def initialize(app, root = nil)
super app, root, 'Tzispa::Engine::Rig'
end
|
Instance Method Details
#api(path, controller: nil, methods: nil) ⇒ Object
23
24
25
|
# File 'lib/tzispa/engine/rig/router.rb', line 23
def api(path, controller: nil, methods: nil)
add :api, path, controller || 'api', methods: methods
end
|
#index(path, controller: nil, methods: nil) ⇒ Object
14
15
16
|
# File 'lib/tzispa/engine/rig/router.rb', line 14
def index(path, controller: nil, methods: nil)
add :index, path, controller || 'layout', methods: methods
end
|
#layout(layout, path, controller: nil, methods: nil) ⇒ Object
18
19
20
21
|
# File 'lib/tzispa/engine/rig/router.rb', line 18
def layout(layout, path, controller: nil, methods: nil)
add layout, path, controller || 'layout', methods: methods,
matching: { layout: layout.to_s }
end
|
#signed_api(path, controller: nil, methods: nil) ⇒ Object
27
28
29
|
# File 'lib/tzispa/engine/rig/router.rb', line 27
def signed_api(path, controller: nil, methods: nil)
add :sapi, path, controller || 'api', methods: methods
end
|