Module: PdfMatcher::PdfFile
- Defined in:
- lib/pdf_matcher/pdf_file.rb
Defined Under Namespace
Classes: Base, File, Tempfile
Class Method Summary
collapse
Class Method Details
.init(path_or_data) ⇒ Object
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/pdf_matcher/pdf_file.rb', line 7
def self.init(path_or_data)
case path_or_data
when Pathname
File.new(path_or_data)
when String
if path_or_data =~ /^%PDF-/
Tempfile.new(path_or_data)
else
File.new(path_or_data)
end
else
raise ArgumentError
end
end
|