Class: Ilovepdf::Tool::Compress
- Inherits:
-
Ilovepdf::Task
- Object
- Ilovepdf
- Ilovepdf::Task
- Ilovepdf::Tool::Compress
- Defined in:
- lib/ilovepdf/tool/compress.rb
Constant Summary collapse
- API_PARAMS =
[:compression_level]
- COMPRESSION_LEVEL_VALUES =
["extreme", "recommended", "low"]
Constants inherited from Ilovepdf::Task
Constants included from Ilovepdf
Instance Attribute Summary
Attributes inherited from Ilovepdf::Task
#ignore_errors, #ignore_password, #output_filename, #packaged_filename, #result, #task_id, #tool, #try_pdf_repair
Instance Method Summary collapse
- #compression_level=(level) ⇒ Object
-
#initialize(public_key, secret_key, make_start = true) ⇒ Compress
constructor
A new instance of Compress.
Methods inherited from Ilovepdf::Task
#add_file, #add_file_from_url, #assign_meta_value, #blob, #chained_task?, #delete!, #delete_file, #download, #download_info, #enable_file_encryption, #execute, #files, #next, #status
Methods included from Ilovepdf
Constructor Details
#initialize(public_key, secret_key, make_start = true) ⇒ Compress
Returns a new instance of Compress.
9 10 11 12 |
# File 'lib/ilovepdf/tool/compress.rb', line 9 def initialize(public_key, secret_key, make_start=true) self.tool = :compress super(public_key, secret_key, make_start) end |
Instance Method Details
#compression_level=(level) ⇒ Object
14 15 16 17 |
# File 'lib/ilovepdf/tool/compress.rb', line 14 def compression_level= level raise Errors::ArgumentEnumError.new(COMPRESSION_LEVEL_VALUES) unless COMPRESSION_LEVEL_VALUES.include? level @compression_level = level end |