lib/grape/route.rb in grape-0.6.0 vs lib/grape/route.rb in grape-0.6.1
- old
+ new
@@ -1,26 +1,28 @@
module Grape
# A compiled route for inspection.
class Route
-
+
def initialize(options = {})
@options = options || {}
end
-
+
def method_missing(method_id, *arguments)
- if match = /route_([_a-zA-Z]\w*)/.match(method_id.to_s)
+ match = /route_([_a-zA-Z]\w*)/.match(method_id.to_s)
+ if match
@options[match.captures.last.to_sym]
else
super
end
end
-
+
def to_s
"version=#{route_version}, method=#{route_method}, path=#{route_path}"
end
private
+
def to_ary
nil
end
end