Class: Omnizip::Profile::TextProfile
- Inherits:
-
CompressionProfile
- Object
- CompressionProfile
- Omnizip::Profile::TextProfile
- Defined in:
- lib/omnizip/profile/text_profile.rb
Overview
Text compression profile
Optimized for compressing text files. Uses PPMd7 which excels at text compression through context modeling.
Instance Attribute Summary
Attributes inherited from CompressionProfile
#algorithm, #description, #filter, #level, #name, #solid
Instance Method Summary collapse
-
#initialize ⇒ TextProfile
constructor
Initialize text profile.
-
#suitable_for?(mime_type) ⇒ Boolean
Check if this profile is suitable for a MIME type.
Methods inherited from CompressionProfile
#apply_to, #inspect, #to_h, #to_s
Constructor Details
#initialize ⇒ TextProfile
Initialize text profile
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/omnizip/profile/text_profile.rb', line 11 def initialize super( name: :text, algorithm: :ppmd7, level: 6, filter: nil, solid: false, description: "Optimized for text files" ) end |
Instance Method Details
#suitable_for?(mime_type) ⇒ Boolean
Check if this profile is suitable for a MIME type
26 27 28 29 30 |
# File 'lib/omnizip/profile/text_profile.rb', line 26 def suitable_for?(mime_type) return true unless mime_type FileType::MimeClassifier.text?(mime_type) end |