Class: Ilovepdf::Tool::Compress

Inherits:
Ilovepdf::Task show all
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

Ilovepdf::Task::DOWNLOAD_INFO

Constants included from Ilovepdf

VERSION

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

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

root

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