Class: Vedeu::Output::Compressors::Simple Private
- Inherits:
-
Object
- Object
- Vedeu::Output::Compressors::Simple
- Defined in:
- lib/vedeu/output/compressors/simple.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.
A simple compressor which does not compress- it converts each buffer object into a string and returns the resulting blob of text.
Instance Attribute Summary collapse
- #content ⇒ void readonly protected private
Class Method Summary collapse
- .with(content) ⇒ String private
Instance Method Summary collapse
- #compress ⇒ String private
- #initialize(content) ⇒ Vedeu::Output::Compressors::Simple constructor private
- #message ⇒ String private private
Constructor Details
#initialize(content) ⇒ Vedeu::Output::Compressors::Simple
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.
25 26 27 |
# File 'lib/vedeu/output/compressors/simple.rb', line 25 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.
43 44 45 |
# File 'lib/vedeu/output/compressors/simple.rb', line 43 def content @content end |
Class Method Details
.with(content) ⇒ String
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.
19 20 21 |
# File 'lib/vedeu/output/compressors/simple.rb', line 19 def self.with(content) new(content).compress end |
Instance Method Details
#compress ⇒ String
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.
30 31 32 33 34 35 36 37 |
# File 'lib/vedeu/output/compressors/simple.rb', line 30 def compress Vedeu.timer('Stringifying cells...') do content.map(&:to_s).join end.tap do |out| Vedeu.log(type: :compress, message: "#{} -> #{out.size} characters") 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.
48 49 50 |
# File 'lib/vedeu/output/compressors/simple.rb', line 48 def "Compression for #{content.size} objects" end |