Class: Pdf2htmlDocker::OptionBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/pdf2html_docker/option_builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of OptionBuilder.



65
66
67
68
69
# File 'lib/pdf2html_docker/option_builder.rb', line 65

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

Instance Attribute Details

#keysObject (readonly)

Returns the value of attribute keys.



63
64
65
# File 'lib/pdf2html_docker/option_builder.rb', line 63

def keys
  @keys
end

Instance Method Details

#to_hObject



78
79
80
# File 'lib/pdf2html_docker/option_builder.rb', line 78

def to_h
  @options.merge(@args)
end

#to_sObject



71
72
73
74
75
76
# File 'lib/pdf2html_docker/option_builder.rb', line 71

def to_s
  return '' if @keys.empty?

  (array_from_options(@options, CONVERTER_OPTIONS) +
    CONVERTER_ARGS).join(' ')
end