Class: Chespirito::Route
- Inherits:
-
Object
- Object
- Chespirito::Route
- Defined in:
- lib/chespirito/routes/route.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#controller_klass ⇒ Object
readonly
Returns the value of attribute controller_klass.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#verb ⇒ Object
readonly
Returns the value of attribute verb.
Instance Method Summary collapse
-
#initialize(*attrs) ⇒ Route
constructor
A new instance of Route.
- #key ⇒ Object
Constructor Details
#initialize(*attrs) ⇒ Route
Returns a new instance of Route.
7 8 9 10 |
# File 'lib/chespirito/routes/route.rb', line 7 def initialize(*attrs) @verb, @path, @trait = attrs @controller_klass, @action = @trait end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
5 6 7 |
# File 'lib/chespirito/routes/route.rb', line 5 def action @action end |
#controller_klass ⇒ Object (readonly)
Returns the value of attribute controller_klass.
5 6 7 |
# File 'lib/chespirito/routes/route.rb', line 5 def controller_klass @controller_klass end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
5 6 7 |
# File 'lib/chespirito/routes/route.rb', line 5 def path @path end |
#verb ⇒ Object (readonly)
Returns the value of attribute verb.
5 6 7 |
# File 'lib/chespirito/routes/route.rb', line 5 def verb @verb end |
Instance Method Details
#key ⇒ Object
12 |
# File 'lib/chespirito/routes/route.rb', line 12 def key = "#{@verb} #{@path}" |