# File lib/apipie_bindings/route.rb, line 13 def params_in_path @path.scan(/:([^\/]*)/).map { |m| m.first } end
# File lib/apipie_bindings/route.rb, line 17 def path(params=nil) return @path if params.nil? path = params_in_path.inject(@path) do |p, param_name| param_value = (params[param_name.to_sym] or params[param_name.to_s]) or raise ArgumentError, "missing param '#{param_name}' in parameters" p.sub(":#{param_name}", URI.escape(param_value.to_s)) end end
Generated with the Darkfish Rdoc Generator 2.