Class: RoutesJS::Formatter
- Inherits:
-
Object
- Object
- RoutesJS::Formatter
- Defined in:
- lib/routesjs/formatter.rb
Constant Summary collapse
- REDIRECT_URL =
/\Aredirect\(\d+,([^)]+)\)\z/.freeze
Instance Method Summary collapse
- #header(routes) ⇒ Object
- #no_routes ⇒ Object
- #result ⇒ Object
- #routes ⇒ Object
- #section(routes_in_section) ⇒ Object
- #section_title(title) ⇒ Object
Instance Method Details
#header(routes) ⇒ Object
16 |
# File 'lib/routesjs/formatter.rb', line 16 def header(routes); end |
#no_routes ⇒ Object
15 |
# File 'lib/routesjs/formatter.rb', line 15 def no_routes; end |
#result ⇒ Object
11 12 13 |
# File 'lib/routesjs/formatter.rb', line 11 def result routes.to_json end |
#routes ⇒ Object
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 |