class Stringex::Configuration::Configurator

Attributes

klass[RW]

Public Class Methods

new(klass) click to toggle source
   # File lib/stringex/configuration/configurator.rb
 6 def initialize(klass)
 7   @klass = klass
 8 
 9   self.klass.valid_configuration_details.each do |name|
10     define_instance_method_for_configuration_wrapper name
11   end
12 end

Public Instance Methods

define_instance_method_for_configuration_wrapper(name) click to toggle source
   # File lib/stringex/configuration/configurator.rb
14 def define_instance_method_for_configuration_wrapper(name)
15   name = name.respond_to?(:intern) ? name.intern : name
16   (class << self; self; end).instance_eval do
17     define_method("#{name}=") do |value|
18       customizations = klass.send(:system_wide_customizations)
19       customizations[name] = value
20     end
21   end
22 end