Class: ProgeressLogger
- Inherits:
-
Object
- Object
- ProgeressLogger
- Includes:
- Comparable
- Defined in:
- lib/s3streambackup.rb
Instance Method Summary collapse
- #<<(bytes) ⇒ Object
- #<=>(value) ⇒ Object
- #in_bytes_auto ⇒ Object
-
#initialize ⇒ ProgeressLogger
constructor
A new instance of ProgeressLogger.
- #log(logger, postfix) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ ProgeressLogger
Returns a new instance of ProgeressLogger.
109 110 111 |
# File 'lib/s3streambackup.rb', line 109 def initialize @bytes = 0 end |
Instance Method Details
#<<(bytes) ⇒ Object
120 121 122 |
# File 'lib/s3streambackup.rb', line 120 def <<(bytes) @bytes += bytes end |
#<=>(value) ⇒ Object
129 130 131 |
# File 'lib/s3streambackup.rb', line 129 def <=>(value) @bytes <=> value end |
#in_bytes_auto ⇒ Object
133 134 135 |
# File 'lib/s3streambackup.rb', line 133 def in_bytes_auto @bytes.in_bytes_auto end |
#log(logger, postfix) ⇒ Object
113 114 115 116 117 118 |
# File 'lib/s3streambackup.rb', line 113 def log(logger, postfix) if logger.debug? was, @output_bytes = @output_bytes || '', @bytes.in_bytes_auto logger.debug "#{@output_bytes}#{postfix}" end end |
#to_s ⇒ Object
124 125 126 |
# File 'lib/s3streambackup.rb', line 124 def to_s @bytes.to_s end |