Class: Aikido::Zen::Rails::Route
- Inherits:
-
Aikido::Zen::Route
- Object
- Aikido::Zen::Route
- Aikido::Zen::Rails::Route
- Defined in:
- lib/aikido/zen/request/rails_router.rb
Instance Attribute Summary collapse
-
#verb ⇒ Object
readonly
Returns the value of attribute verb.
Instance Method Summary collapse
-
#initialize(rails_route, verb: rails_route.verb, prefix: nil) ⇒ Route
constructor
A new instance of Route.
- #path ⇒ Object
Methods inherited from Aikido::Zen::Route
#==, #as_json, #hash, #inspect
Constructor Details
#initialize(rails_route, verb: rails_route.verb, prefix: nil) ⇒ Route
Returns a new instance of Route.
69 70 71 72 73 |
# File 'lib/aikido/zen/request/rails_router.rb', line 69 def initialize(rails_route, verb: rails_route.verb, prefix: nil) @route = ActionDispatch::Routing::RouteWrapper.new(rails_route) @verb = verb @prefix = prefix end |
Instance Attribute Details
#verb ⇒ Object (readonly)
Returns the value of attribute verb.
67 68 69 |
# File 'lib/aikido/zen/request/rails_router.rb', line 67 def verb @verb end |
Instance Method Details
#path ⇒ Object
75 76 77 78 79 80 81 |
# File 'lib/aikido/zen/request/rails_router.rb', line 75 def path if @prefix.present? File.join(@prefix.to_s, @route.path).chomp("/") else @route.path end end |