Class: Nameday::VvcPdfExtractor
- Inherits:
-
Object
- Object
- Nameday::VvcPdfExtractor
- Defined in:
- lib/nameday_vvc_pdf_extractor.rb
Constant Summary collapse
- EMPTY_NAMEDAY_REGEXP =
Unicode category “Punctuation: Dash”
/\p{Pd}/
- TEXT_ROW_DELIMITER =
"\n"
- MONTH_NAMES =
%w[ - JANVĀRIS FEBRUĀRIS MARTS APRĪLIS MAIJS JŪNIJS JŪLIJS AUGUSTS SEPTEMBRIS OKTOBRIS NOVEMBRIS DECEMBRIS ].freeze
Instance Attribute Summary collapse
-
#output ⇒ Object
readonly
Returns the value of attribute output.
Instance Method Summary collapse
- #extract ⇒ Object
-
#initialize ⇒ VvcPdfExtractor
constructor
A new instance of VvcPdfExtractor.
- #read_pdf(file_name) ⇒ Object
Constructor Details
#initialize ⇒ VvcPdfExtractor
Returns a new instance of VvcPdfExtractor.
28 29 30 |
# File 'lib/nameday_vvc_pdf_extractor.rb', line 28 def initialize @output = {} end |
Instance Attribute Details
#output ⇒ Object (readonly)
Returns the value of attribute output.
26 27 28 |
# File 'lib/nameday_vvc_pdf_extractor.rb', line 26 def output @output end |
Instance Method Details
#extract ⇒ Object
36 37 38 39 40 |
# File 'lib/nameday_vvc_pdf_extractor.rb', line 36 def extract raise("PDF not opened!") unless @pdf_reader process_pdf output end |
#read_pdf(file_name) ⇒ Object
32 33 34 |
# File 'lib/nameday_vvc_pdf_extractor.rb', line 32 def read_pdf(file_name) @pdf_reader = ::PDF::Reader.new(file_name) end |