Class: Pdf4me::OptimizeByProfile

Inherits:
WrapperAction show all
Defined in:
lib/pdf4me/actions/optimize_by_profile.rb

Instance Attribute Summary collapse

Attributes inherited from WrapperAction

#client

Instance Method Summary collapse

Methods inherited from WrapperAction

#assign_attributes, #initialize, #run, #run!

Constructor Details

This class inherits a constructor from Pdf4me::WrapperAction

Instance Attribute Details

#fileObject

Returns the value of attribute file.



3
4
5
# File 'lib/pdf4me/actions/optimize_by_profile.rb', line 3

def file
  @file
end

#profileObject

Returns the value of attribute profile.



3
4
5
# File 'lib/pdf4me/actions/optimize_by_profile.rb', line 3

def profile
  @profile
end

#save_pathObject

Returns the value of attribute save_path.



3
4
5
# File 'lib/pdf4me/actions/optimize_by_profile.rb', line 3

def save_path
  @save_path
end

Instance Method Details

#call_apiObject



34
35
36
37
38
39
40
41
42
# File 'lib/pdf4me/actions/optimize_by_profile.rb', line 34

def call_api
  client.multipart_post(
    path,
    file: File.open(file, 'rb'),
    profile: profile
  ) do |request|
    download(request, save_path)
  end
end

#defaultsObject



18
19
20
21
22
# File 'lib/pdf4me/actions/optimize_by_profile.rb', line 18

def defaults
  {
    profile: 'default'
  }
end

#pathObject



24
25
26
# File 'lib/pdf4me/actions/optimize_by_profile.rb', line 24

def path
  '/Optimize/OptimizeByProfile'
end