module Temple::Mixins::ClassOptions

@api public

Public Instance Methods

default_options() click to toggle source
# File lib/temple/mixins/options.rb, line 11
def default_options
  warn 'default_options has been deprecated, use options'
  options
end
define_deprecated_options(*opts) click to toggle source
# File lib/temple/mixins/options.rb, line 36
def define_deprecated_options(*opts)
  if opts.last.respond_to?(:to_hash)
    hash = opts.pop.to_hash
    options.add_deprecated_keys(hash.keys)
    options.update(hash)
  end
  options.add_deprecated_keys(opts)
end
define_options(*opts) click to toggle source
# File lib/temple/mixins/options.rb, line 27
def define_options(*opts)
  if opts.last.respond_to?(:to_hash)
    hash = opts.pop.to_hash
    options.add_valid_keys(hash.keys)
    options.update(hash)
  end
  options.add_valid_keys(opts)
end
disable_option_validator!() click to toggle source
# File lib/temple/mixins/options.rb, line 45
def disable_option_validator!
  @option_validator_disabled = true
end
options() click to toggle source
# File lib/temple/mixins/options.rb, line 20
def options
  @options ||= OptionMap.new(superclass.respond_to?(:options) ?
                             superclass.options : nil) do |hash, key, what|
    warn "#{self}: Option #{key.inspect} is #{what}" unless @option_validator_disabled
  end
end
set_default_options(opts) click to toggle source
# File lib/temple/mixins/options.rb, line 6
def set_default_options(opts)
  warn 'set_default_options has been deprecated, use set_options'
  set_options(opts)
end
set_options(opts) click to toggle source
# File lib/temple/mixins/options.rb, line 16
def set_options(opts)
  options.update(opts)
end