Class: PdfEditor::RotatePage
- Inherits:
-
Object
- Object
- PdfEditor::RotatePage
- Defined in:
- lib/pdf_editor/rotate_page.rb
Constant Summary collapse
- ROTATIONS =
{ left: 'left', right: 'right', flip: 'down' }
Constants included from Errors
Errors::ArgumentMissingError, Errors::InvalidInputError, Errors::InvalidPDFError, Errors::PageCountError, Errors::PageOrderInvalidError, Errors::PageRangeError, Errors::ResourcesEmptyError, Errors::TitlePageTitleError
Constants included from Service
Service::InterfaceNotImplementedError, Service::MustPassBlockToAsTempfile
Instance Attribute Summary collapse
-
#page ⇒ Object
readonly
Returns the value of attribute page.
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
-
#rotate ⇒ Object
readonly
Returns the value of attribute rotate.
Instance Method Summary collapse
Methods included from PdfRunner
Methods included from Service
Instance Attribute Details
#page ⇒ Object (readonly)
Returns the value of attribute page.
18 19 20 |
# File 'lib/pdf_editor/rotate_page.rb', line 18 def page @page end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
18 19 20 |
# File 'lib/pdf_editor/rotate_page.rb', line 18 def resource @resource end |
#rotate ⇒ Object (readonly)
Returns the value of attribute rotate.
18 19 20 |
# File 'lib/pdf_editor/rotate_page.rb', line 18 def rotate @rotate end |
Instance Method Details
#call ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/pdf_editor/rotate_page.rb', line 26 def call if resource.nil? || page.nil? || rotate.nil? raise Errors::ArgumentMissingError, "resource: #{resource} \n page: #{page} \n rotate: #{rotate}" end PdfEditor::Resource.new( create_tempfile {run_command} ) end |
#post_init ⇒ Object
20 21 22 23 24 |
# File 'lib/pdf_editor/rotate_page.rb', line 20 def post_init @resource = args.fetch(:resource, nil) @page = args.fetch(:page, nil) @rotate = ROTATIONS[args.fetch(:rotate, '')] end |