Module: ConfigSL::DSL::ClassMethods
- Defined in:
- lib/configsl/dsl.rb
Overview
Required class methods for the config DSL.
Instance Method Summary collapse
-
#option(name, opts = {}) ⇒ void
Define an option for the class.
-
#options ⇒ Hash
Returns the options hash for the class.
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.
99 100 101 102 103 104 |
# File 'lib/configsl/dsl.rb', line 99 def option(name, opts = {}) [name] = opts define_method(name) { get_value(name) } define_method("#{name}=") { |val| set_value(name, val) } end |
#options ⇒ Hash
Returns the options hash for the class.
109 110 111 |
# File 'lib/configsl/dsl.rb', line 109 def @options ||= {} end |