Class: Configurability::SettingInstaller
- Inherits:
-
Object
- Object
- Configurability::SettingInstaller
- Extended by:
- Loggability
- Defined in:
- lib/configurability/setting_installer.rb
Overview
Methods for declaring config methods and constants inside a ‘configurability` block.
Instance Attribute Summary collapse
-
#target ⇒ Object
readonly
The target object.
Instance Method Summary collapse
-
#initialize(target) ⇒ SettingInstaller
constructor
Create a new Generator that can be used to add configuration methods and constants to the specified
targetobject. -
#setting(name, **options, &block) ⇒ Object
Declare a config setting with the specified
name.
Constructor Details
#initialize(target) ⇒ SettingInstaller
Create a new Generator that can be used to add configuration methods and constants to the specified target object.
18 19 20 |
# File 'lib/configurability/setting_installer.rb', line 18 def initialize( target ) @target = target end |
Instance Attribute Details
#target ⇒ Object (readonly)
The target object
25 26 27 |
# File 'lib/configurability/setting_installer.rb', line 25 def target @target end |
Instance Method Details
#setting(name, **options, &block) ⇒ Object
Declare a config setting with the specified name.
29 30 31 32 33 |
# File 'lib/configurability/setting_installer.rb', line 29 def setting( name, **, &block ) self.log.debug " adding %s setting to %p" % [ name, self.target ] self.add_setting_accessors( name, , &block ) self.add_default( name, ) end |