Class: NoopBackup::Tee::Sink
- Inherits:
-
Struct
- Object
- Struct
- NoopBackup::Tee::Sink
- Defined in:
- lib/noop_backup/tee.rb
Instance Attribute Summary collapse
-
#store ⇒ Object
Returns the value of attribute store.
-
#thread ⇒ Object
Returns the value of attribute thread.
-
#writer ⇒ Object
Returns the value of attribute writer.
Instance Method Summary collapse
Instance Attribute Details
#store ⇒ Object
Returns the value of attribute store
3 4 5 |
# File 'lib/noop_backup/tee.rb', line 3 def store @store end |
#thread ⇒ Object
Returns the value of attribute thread
3 4 5 |
# File 'lib/noop_backup/tee.rb', line 3 def thread @thread end |
#writer ⇒ Object
Returns the value of attribute writer
3 4 5 |
# File 'lib/noop_backup/tee.rb', line 3 def writer @writer end |
Instance Method Details
#close ⇒ Object
14 15 16 |
# File 'lib/noop_backup/tee.rb', line 14 def close writer.close end |
#collect ⇒ Object
18 19 20 21 22 |
# File 'lib/noop_backup/tee.rb', line 18 def collect thread.value rescue nil end |
#write(chunk) ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/noop_backup/tee.rb', line 4 def write(chunk) return if @error writer.write(chunk) rescue Errno::EPIPE, IOError => e @error = e close unless writer.closed? end |