Class: Expire::ReportBase

Inherits:
ReportNull show all
Defined in:
lib/expire/report_base.rb

Overview

Base class for Reporters

Direct Known Subclasses

ReportExpired, ReportKept, ReportSimple

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ReportNull

#after_all, #after_purge, #before_all, #before_purge, #on_keep

Constructor Details

#initialize(receiver: $stdout) ⇒ ReportBase

Returns a new instance of ReportBase.



9
10
11
# File 'lib/expire/report_base.rb', line 9

def initialize(receiver: $stdout)
  @receiver = receiver
end

Instance Attribute Details

#receiverObject (readonly)

Returns the value of attribute receiver.



13
14
15
# File 'lib/expire/report_base.rb', line 13

def receiver
  @receiver
end

Instance Method Details

#error(message) ⇒ Object



15
16
17
# File 'lib/expire/report_base.rb', line 15

def error(message)
  receiver.puts(pastel.red(message))
end

#pastelObject



19
20
21
# File 'lib/expire/report_base.rb', line 19

def pastel
  @pastel ||= ::Pastel.new
end