module SmoothOperator::Options

Public Instance Methods

config_options() click to toggle source
# File lib/smooth_operator/options.rb, line 19
def config_options
  Helpers.get_instance_variable(self, :config_options, {})
end
get_option(option, default, *args) click to toggle source
# File lib/smooth_operator/options.rb, line 4
def get_option(option, default, *args)
  return default unless config_options.include?(option)

  _option = config_options[option]

  case _option
  when Symbol
    respond_to?(_option) ? send(_option, *args) : _option
  when Proc
    _option.call(*args)
  else
    _option
  end
end
options(options = {})
smooth_operator_options(options = {}) click to toggle source
# File lib/smooth_operator/options.rb, line 23
def smooth_operator_options(options = {})
  config_options.merge!(options)
end
Also aliased as: options