Module: Axlsx::OptionsParser

Overview

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

Instance Method Summary collapse

Instance Method Details

#parse_options(options = {}) ⇒ Object

Parses an options hash by calling any defined method by the same name of the key postfixed with an '='

Parameters:

  • options (Hash) (defaults to: {})

    Options to parse.



10
11
12
13
14
15
# File 'lib/axlsx/util/options_parser.rb', line 10

def parse_options(options = {})
  options.each do |key, value|
    key = :"#{key}="
    send(key, value) if !value.nil? && respond_to?(key)
  end
end