Sha256: fd061e2f8e7e6184ccb3d84091818eaea22bd98c845f4e4d92e31be0821f2a08

Contents?: true

Size: 499 Bytes

Versions: 5

Compression:

Stored size: 499 Bytes

Contents

# frozen_string_literal: true

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}="
        send(key, value) if !value.nil? && respond_to?(key)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/caxlsx-4.1.0/lib/axlsx/util/options_parser.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/caxlsx-4.1.0/lib/axlsx/util/options_parser.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/caxlsx-4.1.0/lib/axlsx/util/options_parser.rb
caxlsx-4.1.0 lib/axlsx/util/options_parser.rb
caxlsx-4.0.0 lib/axlsx/util/options_parser.rb