Class: Stevedore::Pdf
- Inherits:
-
Object
- Object
- Stevedore::Pdf
- Defined in:
- lib/stevedore/pdf.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#file_path ⇒ Object
readonly
Returns the value of attribute file_path.
Instance Method Summary collapse
- #images(base_dir = tmp_dir) ⇒ Object
-
#initialize(file_path) ⇒ Pdf
constructor
A new instance of Pdf.
- #metadata ⇒ Object
- #num_pages ⇒ Object
- #page_size ⇒ Object
- #tmp_dir ⇒ Object
Constructor Details
#initialize(file_path) ⇒ Pdf
Returns a new instance of Pdf.
4 5 6 |
# File 'lib/stevedore/pdf.rb', line 4 def initialize(file_path) @file_path = file_path end |
Instance Attribute Details
#file_path ⇒ Object (readonly)
Returns the value of attribute file_path.
2 3 4 |
# File 'lib/stevedore/pdf.rb', line 2 def file_path @file_path end |
Instance Method Details
#images(base_dir = tmp_dir) ⇒ Object
43 44 45 |
# File 'lib/stevedore/pdf.rb', line 43 def images(base_dir = tmp_dir) @images ||= Image.extract_all(self, base_dir) end |
#metadata ⇒ Object
8 9 10 |
# File 'lib/stevedore/pdf.rb', line 8 def @metadata ||= Metadata.new(self) end |
#num_pages ⇒ Object
12 13 14 |
# File 'lib/stevedore/pdf.rb', line 12 def num_pages .num_pages end |
#page_size ⇒ Object
16 17 18 |
# File 'lib/stevedore/pdf.rb', line 16 def page_size .page_size end |
#tmp_dir ⇒ Object
47 48 49 |
# File 'lib/stevedore/pdf.rb', line 47 def tmp_dir @dir ||= Dir.mktmpdir end |