Sha256: 6b46c90f9a579b08f39ed3a760384fe7ea8a03de4ee08f3be96fe81a1dc87d39

Contents?: true

Size: 493 Bytes

Versions: 1

Compression:

Stored size: 493 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

1 entries across 1 versions & 1 rubygems

Version Path
caxlsx-3.2.0 lib/axlsx/util/options_parser.rb