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 private
- #compress_size ⇒ Fixnum private private
- #initialize(content) ⇒ Vedeu::Output::Compressors::Simple constructor private
- #original_size ⇒ Fixnum private private
- #with ⇒ String 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.
42 43 44 |
# File 'lib/vedeu/output/compressors/simple.rb', line 42 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).with end |
Instance Method Details
#compress ⇒ 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.
47 48 49 |
# File 'lib/vedeu/output/compressors/simple.rb', line 47 def compress @_compress ||= content.map(&:to_s).join end |
#compress_size ⇒ Fixnum (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.
52 53 54 |
# File 'lib/vedeu/output/compressors/simple.rb', line 52 def compress_size compress.size end |
#original_size ⇒ Fixnum (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.
57 58 59 |
# File 'lib/vedeu/output/compressors/simple.rb', line 57 def original_size content.size end |
#with ⇒ 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 |
# File 'lib/vedeu/output/compressors/simple.rb', line 30 def with Vedeu.log(type: :compress, message: "No compression for #{original_size} objects -> " \ "#{compress_size} characters") compress end |