Class: Kangaru::PathParser
- Inherits:
-
Object
- Object
- Kangaru::PathParser
- Defined in:
- lib/kangaru/path_parser.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #action ⇒ Object
- #controller ⇒ Object
- #id ⇒ Object
-
#initialize(path) ⇒ PathParser
constructor
A new instance of PathParser.
Constructor Details
#initialize(path) ⇒ PathParser
Returns a new instance of PathParser.
5 6 7 |
# File 'lib/kangaru/path_parser.rb', line 5 def initialize(path) @path = path end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
3 4 5 |
# File 'lib/kangaru/path_parser.rb', line 3 def path @path end |
Instance Method Details
#action ⇒ Object
13 14 15 |
# File 'lib/kangaru/path_parser.rb', line 13 def action match(:action, cast: :to_sym) end |
#controller ⇒ Object
9 10 11 |
# File 'lib/kangaru/path_parser.rb', line 9 def controller match(:controller) end |
#id ⇒ Object
17 18 19 |
# File 'lib/kangaru/path_parser.rb', line 17 def id match(:id, cast: :to_i) end |