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.



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

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