Class: Grape::Route
- Inherits:
-
Object
- Object
- Grape::Route
- Defined in:
- lib/grape/route.rb
Overview
A compiled route for inspection.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Route
constructor
private
A new instance of Route.
- #method_missing(method_id, *arguments) ⇒ Object private
-
#to_s ⇒ Object
Generate a short, human-readable representation of this route.
Constructor Details
#initialize(options = {}) ⇒ Route
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Route.
5 6 7 |
# File 'lib/grape/route.rb', line 5 def initialize( = {}) @options = || {} end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_id, *arguments) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
10 11 12 13 14 15 16 17 |
# File 'lib/grape/route.rb', line 10 def method_missing(method_id, *arguments) match = /route_([_a-zA-Z]\w*)/.match(method_id.to_s) if match @options[match.captures.last.to_sym] else super end end |
Instance Method Details
#to_s ⇒ Object
Generate a short, human-readable representation of this route.
20 21 22 |
# File 'lib/grape/route.rb', line 20 def to_s "version=#{route_version}, method=#{route_method}, path=#{route_path}" end |