Class: PDFShaver::Document
- Inherits:
-
Object
- Object
- PDFShaver::Document
- Defined in:
- lib/pdfshaver/document.rb
Instance Attribute Summary collapse
-
#length ⇒ Object
readonly
Returns the value of attribute length.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(path, options = {}) ⇒ Document
constructor
A new instance of Document.
- #pages(page_list = :all) ⇒ Object
Constructor Details
#initialize(path, options = {}) ⇒ Document
Returns a new instance of Document.
5 6 7 8 9 10 11 |
# File 'lib/pdfshaver/document.rb', line 5 def initialize path, ={} raise ArgumentError, "Can't find a file at '#{path}' to open" unless File.exists? path # otherwise attempt to acquire it. @path = path open_document_with_pdfium(path) end |
Instance Attribute Details
#length ⇒ Object (readonly)
Returns the value of attribute length.
3 4 5 |
# File 'lib/pdfshaver/document.rb', line 3 def length @length end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
3 4 5 |
# File 'lib/pdfshaver/document.rb', line 3 def path @path end |
Instance Method Details
#==(other) ⇒ Object
13 14 15 |
# File 'lib/pdfshaver/document.rb', line 13 def == other File.realpath(self.path) == File.realpath(other.path) end |