class PDFMeta::Parser
Public Class Methods
new(output)
click to toggle source
# File lib/pdf_meta/parser.rb, line 4 def initialize(output) @output = output end
Public Instance Methods
results()
click to toggle source
# File lib/pdf_meta/parser.rb, line 8 def results @results ||= PDFMeta::Results.new(parsed_output) end
Private Instance Methods
parsed_output()
click to toggle source
# File lib/pdf_meta/parser.rb, line 14 def parsed_output out = @output.split("\n").map {|x| x.split(':', 2)}.reject(&:empty?) hash = {} out = out.each do |row| hash[row.first.underscore.parameterize.underscore.to_sym] = row.last.strip end hash.reject {|k, v| v.blank?} end