Class: PdfEditor::Shuffle
- Inherits:
-
Object
- Object
- PdfEditor::Shuffle
- Defined in:
- lib/pdf_editor/shuffle.rb
Direct Known Subclasses
Constant Summary
Constants included from Errors
Errors::ArgumentMissingError, Errors::InvalidInputError, Errors::InvalidPDFError, Errors::PageCountError, Errors::PageOrderInvalidError, Errors::PageRangeError, Errors::ResourcesEmptyError, Errors::TitlePageTitleError
Constants included from Service
PdfEditor::Service::InterfaceNotImplementedError, PdfEditor::Service::MustPassBlockToAsTempfile
Instance Attribute Summary collapse
-
#page_order ⇒ Object
readonly
Page order does not require unique members and is not sorted.
-
#resource ⇒ Object
readonly
Page order does not require unique members and is not sorted.
Instance Method Summary collapse
Methods included from PdfRunner
Methods included from Service
Instance Attribute Details
#page_order ⇒ Object (readonly)
Page order does not require unique members and is not sorted. This is the base class for other shuffle operations.
18 19 20 |
# File 'lib/pdf_editor/shuffle.rb', line 18 def page_order @page_order end |
#resource ⇒ Object (readonly)
Page order does not require unique members and is not sorted. This is the base class for other shuffle operations.
18 19 20 |
# File 'lib/pdf_editor/shuffle.rb', line 18 def resource @resource end |
Instance Method Details
#call ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/pdf_editor/shuffle.rb', line 25 def call if resource.nil? raise Errors::ResourcesEmptyError, 'Must have a resource to shuffle' end if page_order.empty? raise Errors::PageOrderInvalidError, 'Page order was invalid' end PdfEditor::Resource.new( create_tempfile {run_command} ) end |
#post_init ⇒ Object
20 21 22 23 |
# File 'lib/pdf_editor/shuffle.rb', line 20 def post_init @resource = args[:resource] @page_order = args.fetch(:page_order, []) end |