Class: Rivulet::Steps::PrintRoutes

Inherits:
Rivulet::Step show all
Defined in:
lib/rivulet/steps/print_routes.rb

Constant Summary collapse

HEADERS =
['HTTP Verb', 'Path', 'Handler#action']
GAP =
2

Instance Method Summary collapse

Methods inherited from Rivulet::Step

container_class_path, inherited

Instance Method Details

#call(input) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/rivulet/steps/print_routes.rb', line 9

def call(input)
  routes = input[:resource].routes

  widths = calculate_widths(routes)

  print_row(HEADERS, widths)
  puts "" # Spacer after header

  routes.each do |route|
    print_route(route, widths)
  end

  Success(input)
end