Class: DatabaseConsistency::RescueError
- Inherits:
-
Object
- Object
- DatabaseConsistency::RescueError
- Defined in:
- lib/database_consistency/rescue_error.rb
Overview
The class writes error to the file
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
Class Method Summary collapse
Instance Method Summary collapse
- #call(error) ⇒ Object
-
#initialize ⇒ RescueError
constructor
A new instance of RescueError.
Constructor Details
#initialize ⇒ RescueError
Returns a new instance of RescueError.
15 16 17 18 19 20 |
# File 'lib/database_consistency/rescue_error.rb', line 15 def initialize puts 'Hey, some of checks fail with an error, please open an issue on github at https://github.com/djezzzl/database_consistency.' puts "Attach the created file: #{filename}" puts 'Thank you, for your contribution!' puts '(c) Evgeniy Demin <[email protected]>' end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
6 7 8 |
# File 'lib/database_consistency/rescue_error.rb', line 6 def error @error end |
Class Method Details
.call(error) ⇒ Object
10 11 12 13 |
# File 'lib/database_consistency/rescue_error.rb', line 10 def self.call(error) @singleton ||= new @singleton.call(error) end |
Instance Method Details
#call(error) ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/database_consistency/rescue_error.rb', line 22 def call(error) File.open(filename, 'a') do |file| file.puts('<===begin===>') file.puts(error.) file.puts('<===end===>') end end |