Module: ConfigSL::DSL::ClassMethods

Defined in:
lib/configsl/dsl.rb

Overview

Required class methods for the config DSL.

Instance Method Summary collapse

Instance Method Details

#option(name, opts = {}) ⇒ void

This method returns an undefined value.

Define an option for the class.

The keys for the options hash will vary depending on the modules that have been included in your class.



82
83
84
85
# File 'lib/configsl/dsl.rb', line 82

def option(name, opts = {})
  options.merge!({ name => opts })
  define_method(name) { get_value(name) }
end

#optionsHash

Returns the options hash for the class.



90
91
92
# File 'lib/configsl/dsl.rb', line 90

def options
  @options ||= {}
end