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
A new instance of Route.
- #method_missing(method_id, *arguments) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Route
Returns a new instance of Route.
6 7 8 |
# File 'lib/grape/route.rb', line 6 def initialize( = {}) @options = || {} end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_id, *arguments) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/grape/route.rb', line 10 def method_missing(method_id, *arguments) if match = /route_([_a-zA-Z]\w*)/.match(method_id.to_s) @options[match.captures.last.to_sym] else super end end |
Instance Method Details
#to_s ⇒ Object
18 19 20 |
# File 'lib/grape/route.rb', line 18 def to_s "version=#{route_version}, method=#{route_method}, path=#{route_path}" end |