Class: DatabaseConsistency::Writers::TodoWriter

Inherits:
BaseWriter
  • Object
show all
Defined in:
lib/database_consistency/writers/todo_writer.rb

Overview

The writer that generates to-do file

Instance Attribute Summary

Attributes inherited from BaseWriter

#config, #results

Instance Method Summary collapse

Methods inherited from BaseWriter

#initialize, write

Constructor Details

This class inherits a constructor from DatabaseConsistency::Writers::BaseWriter

Instance Method Details

#writeObject



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/database_consistency/writers/todo_writer.rb', line 8

def write
  h = results.each_with_object({}) do |result, hash|
    next unless write?(result.status)

    assign_result(hash, result)
  end

  sorted_hash = sort(h)

  File.write(file_name, sorted_hash.to_yaml)
end