Class: ValidRoute::RouteFormatter
- Inherits:
-
Object
- Object
- ValidRoute::RouteFormatter
- Defined in:
- lib/valid_route/route_formatter.rb
Instance Method Summary collapse
- #header(routes) ⇒ Object
-
#initialize ⇒ RouteFormatter
constructor
A new instance of RouteFormatter.
- #no_routes ⇒ Object
- #result ⇒ Object
- #section(routes) ⇒ Object
- #section_title(title) ⇒ Object
Constructor Details
#initialize ⇒ RouteFormatter
Returns a new instance of RouteFormatter.
3 4 5 |
# File 'lib/valid_route/route_formatter.rb', line 3 def initialize @buffer = [] end |
Instance Method Details
#header(routes) ⇒ Object
19 20 |
# File 'lib/valid_route/route_formatter.rb', line 19 def header(routes) end |
#no_routes ⇒ Object
22 23 24 |
# File 'lib/valid_route/route_formatter.rb', line 22 def no_routes @buffer end |
#result ⇒ Object
7 8 9 |
# File 'lib/valid_route/route_formatter.rb', line 7 def result @buffer #.compact.uniq end |
#section(routes) ⇒ Object
14 15 16 17 |
# File 'lib/valid_route/route_formatter.rb', line 14 def section(routes) @buffer << array_paths(routes) @buffer.flatten! end |
#section_title(title) ⇒ Object
11 12 |
# File 'lib/valid_route/route_formatter.rb', line 11 def section_title(title) end |