Class: Vedeu::Output::Compressors::Empty Private
- Inherits:
-
Object
- Object
- Vedeu::Output::Compressors::Empty
- Defined in:
- lib/vedeu/output/compressors/empty.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
The empty compressor removes all empty cells.
Instance Attribute Summary collapse
- #content ⇒ void readonly protected private
Class Method Summary collapse
- .with(content) ⇒ Array private
Instance Method Summary collapse
- #compress ⇒ Array private
- #initialize(content) ⇒ Vedeu::Output::Compressors::Empty constructor private
- #message ⇒ String private private
Constructor Details
#initialize(content) ⇒ Vedeu::Output::Compressors::Empty
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
23 24 25 |
# File 'lib/vedeu/output/compressors/empty.rb', line 23 def initialize(content) @content = content end |
Instance Attribute Details
#content ⇒ void (readonly, protected)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
41 42 43 |
# File 'lib/vedeu/output/compressors/empty.rb', line 41 def content @content end |
Class Method Details
.with(content) ⇒ Array
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
17 18 19 |
# File 'lib/vedeu/output/compressors/empty.rb', line 17 def self.with(content) new(content).compress end |
Instance Method Details
#compress ⇒ Array
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
28 29 30 31 32 33 34 35 |
# File 'lib/vedeu/output/compressors/empty.rb', line 28 def compress Vedeu.timer('Removing empty cells...') do content.reject { |cell| cell.class == Vedeu::Cells::Empty } end.tap do |out| Vedeu.log(type: :compress, message: "#{} -> #{out.size} objects") end end |
#message ⇒ String (private)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
46 47 48 |
# File 'lib/vedeu/output/compressors/empty.rb', line 46 def "Compression for #{content.size} objects" end |