Class: Fern::Documentation::RouteAnalyzer

Inherits:
Object
  • Object
show all
Defined in:
lib/fern/documentation/route_analyzer.rb

Instance Method Summary collapse

Constructor Details

#initialize(route) ⇒ RouteAnalyzer

Returns a new instance of RouteAnalyzer.



4
5
6
# File 'lib/fern/documentation/route_analyzer.rb', line 4

def initialize(route)
  @route = route
end

Instance Method Details

#analyzeObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/fern/documentation/route_analyzer.rb', line 8

def analyze
  return nil if path.nil?

  puts "Analyzing #{path}"

  {
    verb: verb,
    path: path,
    controller_name: controller_name,
    controller: controller,
    action: action,
    params: fern[:params],
    doc: fern[:doc],
    form: fern[:form],
    presenter: fern[:presenter]
  }
end