Sha256: e679b5641b4a9ce86e24733f63ffea170f58730854ff1400419fd7863f10cb48

Contents?: true

Size: 477 Bytes

Versions: 17

Compression:

Stored size: 477 Bytes

Contents

module Axlsx
  # This module defines a single method for parsing options in class
  # initializers.
  module OptionsParser

    # Parses an options hash by calling any defined method by the same
    # name of the key postfixed with an '='
    # @param [Hash] options Options to parse.
    def parse_options(options={})
      options.each do |key, value|
        key = :"#{key}="
        self.send(key, value) if !value.nil? && self.respond_to?(key)
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 6 rubygems

Version Path
caxlsx-3.3.0 lib/axlsx/util/options_parser.rb
caxlsx-3.1.1 lib/axlsx/util/options_parser.rb
caxlsx-3.1.0 lib/axlsx/util/options_parser.rb
bonio-axlsx-2.2.3 lib/axlsx/util/options_parser.rb
caxlsx-3.0.4 lib/axlsx/util/options_parser.rb
caxlsx-3.0.3 lib/axlsx/util/options_parser.rb
caxlsx-3.0.2 lib/axlsx/util/options_parser.rb
caxlsx-3.0.1 lib/axlsx/util/options_parser.rb
caxlsx-3.0.0 lib/axlsx/util/options_parser.rb
axlsx-alt-3.0.1 lib/axlsx/util/options_parser.rb
axlsx-alt-3.0.0 lib/axlsx/util/options_parser.rb
axlsx-3.0.0.pre lib/axlsx/util/options_parser.rb
bonio-axlsx-2.2.2 lib/axlsx/util/options_parser.rb
bonio-axlsx-2.2.1 lib/axlsx/util/options_parser.rb
dg-axlsx-2.1.0 lib/axlsx/util/options_parser.rb
axlsx-2.1.0.pre lib/axlsx/util/options_parser.rb
l_axlsx-2.0.1 lib/axlsx/util/options_parser.rb