Class: RoutesJS::Formatter

Inherits:
Object
  • Object
show all
Defined in:
lib/routesjs/formatter.rb

Constant Summary collapse

REDIRECT_URL =
/\Aredirect\(\d+,([^)]+)\)\z/.freeze

Instance Method Summary collapse

Instance Method Details

#header(routes) ⇒ Object



16
# File 'lib/routesjs/formatter.rb', line 16

def header(routes); end

#no_routesObject



15
# File 'lib/routesjs/formatter.rb', line 15

def no_routes; end

#resultObject



11
12
13
# File 'lib/routesjs/formatter.rb', line 11

def result
  routes.to_json
end

#routesObject



7
8
9
# File 'lib/routesjs/formatter.rb', line 7

def routes
  @routes ||= {}
end

#section(routes_in_section) ⇒ Object



19
20
21
22
23
# File 'lib/routesjs/formatter.rb', line 19

def section(routes_in_section)
  named_routes(routes_in_section).each do |route|
    routes[route_name(route)] = route_path(route)
  end
end

#section_title(title) ⇒ Object



17
# File 'lib/routesjs/formatter.rb', line 17

def section_title(title); end