Class: Configurability::SettingInstaller

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#targetObject (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, **options, &block )
  self.log.debug "  adding %s setting to %p" % [ name, self.target ]
  self.add_setting_accessors( name, options, &block )
  self.add_default( name, options )
end