Class: Pdf4me::SplitByPageNr
- Inherits:
-
WrapperAction
- Object
- WrapperAction
- Pdf4me::SplitByPageNr
- Defined in:
- lib/pdf4me/actions/split_by_page_nr.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
Returns the value of attribute file.
-
#first_pdf ⇒ Object
Returns the value of attribute first_pdf.
-
#page_number ⇒ Object
Returns the value of attribute page_number.
-
#second_pdf ⇒ Object
Returns the value of attribute second_pdf.
Attributes inherited from WrapperAction
Instance Method Summary collapse
Methods inherited from WrapperAction
#assign_attributes, #defaults, #initialize, #run!
Constructor Details
This class inherits a constructor from Pdf4me::WrapperAction
Instance Attribute Details
#file ⇒ Object
Returns the value of attribute file.
3 4 5 |
# File 'lib/pdf4me/actions/split_by_page_nr.rb', line 3 def file @file end |
#first_pdf ⇒ Object
Returns the value of attribute first_pdf.
3 4 5 |
# File 'lib/pdf4me/actions/split_by_page_nr.rb', line 3 def first_pdf @first_pdf end |
#page_number ⇒ Object
Returns the value of attribute page_number.
3 4 5 |
# File 'lib/pdf4me/actions/split_by_page_nr.rb', line 3 def page_number @page_number end |
#second_pdf ⇒ Object
Returns the value of attribute second_pdf.
3 4 5 |
# File 'lib/pdf4me/actions/split_by_page_nr.rb', line 3 def second_pdf @second_pdf end |
Instance Method Details
#call_api ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/pdf4me/actions/split_by_page_nr.rb', line 25 def call_api client.multipart_post( path, file: File.open(file, 'rb'), pageNr: page_number ) end |
#path ⇒ Object
13 14 15 |
# File 'lib/pdf4me/actions/split_by_page_nr.rb', line 13 def path '/Split/SplitByPageNr' end |
#run ⇒ Object
33 34 35 36 37 38 39 |
# File 'lib/pdf4me/actions/split_by_page_nr.rb', line 33 def run validate! response = call_api response.success?.tap do |result| result && save_encoded_files(response) end end |