Class: RoutesCoverage::Formatters::FullText::RouteFormatter
- Inherits:
-
Object
- Object
- RoutesCoverage::Formatters::FullText::RouteFormatter
- Defined in:
- lib/routes_coverage/formatters/full_text.rb
Instance Attribute Summary collapse
-
#buffer ⇒ Object
readonly
Returns the value of attribute buffer.
Instance Method Summary collapse
- #header(routes) ⇒ Object
-
#initialize(result = nil, _settings = nil, output_hits: false) ⇒ RouteFormatter
constructor
A new instance of RouteFormatter.
- #no_routes(_routes_from_rails5 = nil) ⇒ Object
- #result ⇒ Object
- #section(routes) ⇒ Object
- #section_title(title) ⇒ Object
Constructor Details
#initialize(result = nil, _settings = nil, output_hits: false) ⇒ RouteFormatter
Returns a new instance of RouteFormatter.
9 10 11 12 13 14 |
# File 'lib/routes_coverage/formatters/full_text.rb', line 9 def initialize(result = nil, _settings = nil, output_hits: false) @buffer = [] @result = result @output_hits = output_hits @output_prefix = false end |
Instance Attribute Details
#buffer ⇒ Object (readonly)
Returns the value of attribute buffer.
7 8 9 |
# File 'lib/routes_coverage/formatters/full_text.rb', line 7 def buffer @buffer end |
Instance Method Details
#header(routes) ⇒ Object
28 29 30 |
# File 'lib/routes_coverage/formatters/full_text.rb', line 28 def header(routes) @buffer << draw_header(routes) end |
#no_routes(_routes_from_rails5 = nil) ⇒ Object
32 33 34 |
# File 'lib/routes_coverage/formatters/full_text.rb', line 32 def no_routes(_routes_from_rails5 = nil) @buffer << "\tNone" end |
#result ⇒ Object
16 17 18 |
# File 'lib/routes_coverage/formatters/full_text.rb', line 16 def result @buffer.join("\n") end |
#section(routes) ⇒ Object
24 25 26 |
# File 'lib/routes_coverage/formatters/full_text.rb', line 24 def section(routes) @buffer << draw_section(routes) end |
#section_title(title) ⇒ Object
20 21 22 |
# File 'lib/routes_coverage/formatters/full_text.rb', line 20 def section_title(title) @buffer << "\n#{title}:" end |