Class: Fluoride::Analyzer::Parser::Patterner::Rails3

Inherits:
Fluoride::Analyzer::Parser::Patterner show all
Defined in:
lib/fluoride-analyzer/parser.rb

Instance Attribute Summary

Attributes inherited from Fluoride::Analyzer::Parser::Patterner

#rails_routes

Instance Method Summary collapse

Methods inherited from Fluoride::Analyzer::Parser::Patterner

#base_env, #build_request, for, #initialize, #route_map, #route_set

Constructor Details

This class inherits a constructor from Fluoride::Analyzer::Parser::Patterner

Instance Method Details

#build(env) ⇒ Object



150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# File 'lib/fluoride-analyzer/parser.rb', line 150

def build(env)
  req = build_request(env)
  route, matches, params = route_set.recognize(req)

  path_spec = :unrecognized
  segment_keys = {}

  if route_map.has_key?(route)
    rails_route = route_map[route]
    path_spec = rails_route.path
    segment_keys = rails_route.segment_keys
  end

  RoutePattern.new(route, matches, params, path_spec, segment_keys)
end