Class: ValidationErrorReporter::Notifiers::Console

Inherits:
Object
  • Object
show all
Defined in:
lib/validation_error_reporter/notifiers/console.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(configuration, printer = $stdout) ⇒ Console

Returns a new instance of Console.



6
7
8
# File 'lib/validation_error_reporter/notifiers/console.rb', line 6

def initialize(configuration, printer = $stdout)
  @formatter, @printer = Formatter.new, printer
end

Instance Attribute Details

#formatterObject

Returns the value of attribute formatter.



4
5
6
# File 'lib/validation_error_reporter/notifiers/console.rb', line 4

def formatter
  @formatter
end

#printerObject

Returns the value of attribute printer.



4
5
6
# File 'lib/validation_error_reporter/notifiers/console.rb', line 4

def printer
  @printer
end

Instance Method Details

#finalizeObject



14
15
# File 'lib/validation_error_reporter/notifiers/console.rb', line 14

def finalize
end

#notify(message) ⇒ Object



10
11
12
# File 'lib/validation_error_reporter/notifiers/console.rb', line 10

def notify(message)
  printer.puts @formatter.format(message)
end