Class: Wisepdf::Parser

Inherits:
Object show all
Includes:
Singleton
Defined in:
lib/wisepdf/parser.rb

Constant Summary collapse

ESCAPED_OPTIONS =
[
  :pdf, :layout, :template, :action, :partial,
  :object, :collection, :as, :spacer_template,
  :disposition, :locals, :status, :file, :text,
  :xml, :json, :callback, :inline, :location, :save_to_file
]

Class Method Summary collapse

Class Method Details

.parse(options) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/wisepdf/parser.rb', line 13

def parse(options)
  options = self.escape(options)
  options = self.flatten(options)
  parsed_options = {}

  options.each do |key, value|
    unless( value == false || value.nil? )
      normalized_key = "--#{self.normalize_arg(key)}"
      parsed_options[normalized_key] = self.normalize_value(value)
    end
  end
  parsed_options
end