Class: ApiSampler::MatchedRoute

Inherits:
Struct
  • Object
show all
Defined in:
lib/api_sampler/matched_route.rb

Overview

A route which matched the request, along with its path parameters.

Instance Attribute Summary collapse

Instance Attribute Details

#parameters{ Symbol => String }

Returns the path parameters of #route.

Returns:

  • ({ Symbol => String })

    the path parameters of #route.


13
14
15
16
17
# File 'lib/api_sampler/matched_route.rb', line 13

MatchedRoute = Struct.new('MatchedRoute', :route, :parameters) do
  def pattern
    route.path.spec.to_s
  end
end

#patternString (readonly)

Returns the route pattern.

Returns:

  • (String)

    the route pattern.


13
14
15
16
17
# File 'lib/api_sampler/matched_route.rb', line 13

MatchedRoute = Struct.new('MatchedRoute', :route, :parameters) do
  def pattern
    route.path.spec.to_s
  end
end

#routeActionDispath::Journey::Route

Returns the matched route.

Returns:

  • (ActionDispath::Journey::Route)

    the matched route.


13
14
15
16
17
# File 'lib/api_sampler/matched_route.rb', line 13

MatchedRoute = Struct.new('MatchedRoute', :route, :parameters) do
  def pattern
    route.path.spec.to_s
  end
end