Class: Guideline::Renderer
- Inherits:
-
Object
- Object
- Guideline::Renderer
- Defined in:
- lib/guideline/renderer.rb
Instance Method Summary collapse
- #detail ⇒ Object
-
#initialize(errors) ⇒ Renderer
constructor
A new instance of Renderer.
- #summary ⇒ Object
Constructor Details
#initialize(errors) ⇒ Renderer
Returns a new instance of Renderer.
5 6 7 |
# File 'lib/guideline/renderer.rb', line 5 def initialize(errors) @errors = errors end |
Instance Method Details
#detail ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/guideline/renderer.rb', line 9 def detail "".tap do |result| errors_by_path.each do |path, errors| result << "\n#{path}\n" errors.sort_by(&:line).each {|error| result << "#{error.render}\n" } end end end |
#summary ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/guideline/renderer.rb', line 18 def summary "".tap do |result| error_summary.each do |name, count| result << "#{name}: #{count}\n" end end end |