Class: Charming::Router::Route
- Inherits:
-
Data
- Object
- Data
- Charming::Router::Route
- Defined in:
- lib/charming/router.rb
Overview
Route is a Data object holding a route’s path template, target controller/action, title, and resolved params.
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#controller_class ⇒ Object
readonly
Returns the value of attribute controller_class.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action
10 11 12 |
# File 'lib/charming/router.rb', line 10 def action @action end |
#controller_class ⇒ Object (readonly)
Returns the value of attribute controller_class
10 11 12 |
# File 'lib/charming/router.rb', line 10 def controller_class @controller_class end |
#params ⇒ Object (readonly)
Returns the value of attribute params
10 11 12 |
# File 'lib/charming/router.rb', line 10 def params @params end |
#path ⇒ Object (readonly)
Returns the value of attribute path
10 11 12 |
# File 'lib/charming/router.rb', line 10 def path @path end |
#title ⇒ Object (readonly)
Returns the value of attribute title
10 11 12 |
# File 'lib/charming/router.rb', line 10 def title @title end |
Instance Method Details
#with_params(params) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/charming/router.rb', line 11 def with_params(params) self.class.new( path: path, controller_class: controller_class, action: action, title: title, params: params ) end |