Sha256: f084c89a8c42dd7c92c7f57b2d2d33b6a9e929804dd905e35e2ec600a313d077

Contents?: true

Size: 680 Bytes

Versions: 36

Compression:

Stored size: 680 Bytes

Contents

module Stringex
  module Configuration
    class Configurator
      attr_accessor :klass

      def initialize(klass)
        @klass = klass

        self.klass.valid_configuration_details.each do |name|
          define_instance_method_for_configuration_wrapper name
        end
      end

      def define_instance_method_for_configuration_wrapper(name)
        name = name.respond_to?(:intern) ? name.intern : name
        (class << self; self; end).instance_eval do
          define_method("#{name}=") do |value|
            customizations = klass.send(:system_wide_customizations)
            customizations[name] = value
          end
        end
      end
    end
  end
end

Version data entries

36 entries across 35 versions & 2 rubygems

Version Path
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.3.0/gems/stringex-2.8.6/lib/stringex/configuration/configurator.rb
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.1.0/gems/stringex-2.8.6/lib/stringex/configuration/configurator.rb
stringex-2.8.6 lib/stringex/configuration/configurator.rb
stringex-2.8.5 lib/stringex/configuration/configurator.rb
stringex-2.8.4 lib/stringex/configuration/configurator.rb
stringex-2.8.3 lib/stringex/configuration/configurator.rb
stringex-2.8.2 lib/stringex/configuration/configurator.rb
stringex-2.8.1 lib/stringex/configuration/configurator.rb
stringex-2.7.1 lib/stringex/configuration/configurator.rb
stringex-2.7.0 lib/stringex/configuration/configurator.rb
stringex-2.6.1 lib/stringex/configuration/configurator.rb
stringex-2.6.0 lib/stringex/configuration/configurator.rb
stringex-2.5.2 lib/stringex/configuration/configurator.rb
stringex-2.5.1 lib/stringex/configuration/configurator.rb
stringex-2.5.0 lib/stringex/configuration/configurator.rb
stringex-2.4.2 lib/stringex/configuration/configurator.rb
stringex-2.4.1 lib/stringex/configuration/configurator.rb
stringex-2.3.0 lib/stringex/configuration/configurator.rb
stringex-2.2.2 lib/stringex/configuration/configurator.rb
stringex-2.2.1 lib/stringex/configuration/configurator.rb