Class: Pdf2Html::OptionProvider

Inherits:
Object
  • Object
show all
Defined in:
lib/pdf2html/option_provider.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args, options = {}) ⇒ OptionProvider

Returns a new instance of OptionProvider.



51
52
53
54
55
# File 'lib/pdf2html/option_provider.rb', line 51

def initialize(args, options = {})
  @keys = PDF2HTMLEX_OPTIONS.keys & options.keys
  @options = normalize_options(options)
  @args = args
end

Instance Attribute Details

#keysObject (readonly)

Returns the value of attribute keys.



49
50
51
# File 'lib/pdf2html/option_provider.rb', line 49

def keys
  @keys
end

Instance Method Details

#to_hObject



64
65
66
# File 'lib/pdf2html/option_provider.rb', line 64

def to_h
  @options.merge(@args)
end

#to_sObject



57
58
59
60
61
62
# File 'lib/pdf2html/option_provider.rb', line 57

def to_s
  return "" if @keys.empty?

  (array_from_options(@options, PDF2HTMLEX_OPTIONS) + 
    PDF2HTMLEX_ARGS).join(" ")
end