Class: Rodolfo::Reader
- Inherits:
-
Object
- Object
- Rodolfo::Reader
- Defined in:
- lib/rodolfo/reader.rb
Overview
Reads a PDF info and metadata
Instance Method Summary collapse
-
#initialize(pdf) ⇒ Reader
constructor
A new instance of Reader.
- #to_h ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(pdf) ⇒ Reader
Returns a new instance of Reader.
8 9 10 |
# File 'lib/rodolfo/reader.rb', line 8 def initialize(pdf) @reader = PDF::Reader.new pdf end |
Instance Method Details
#to_h ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/rodolfo/reader.rb', line 12 def to_h { PdfVersion: @reader.pdf_version, Info: @reader.info, Meta: @reader., Pages: @reader.page_count } end |
#to_json ⇒ Object
21 22 23 |
# File 'lib/rodolfo/reader.rb', line 21 def to_json JSON.pretty_generate to_h end |