Sha256: eb2e326bd44f1270f64e593e030ff6999b70148054fd70498198dfbf3a52ad48

Contents?: true

Size: 468 Bytes

Versions: 13

Compression:

Stored size: 468 Bytes

Contents

module ThecoreSettings
  # we are inheriting from BasicObject so we don't get a bunch of methods from
  # Kernel or Object
  class Fallback < BasicObject
    def initialize(ns, fb)
      @ns = ns
      @fb = fb
    end

    def inspect
      "#<ThecoreSettings::Fallback ns: #{@ns.inspect}, fb: #{@fb.inspect}>"
    end

    def method_missing(*args)
      @ns.ns_mutex.synchronize do
        @ns.fallback = @fb
        @ns.__send__(*args)
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
thecore_settings-2.0.9 lib/thecore_settings/fallback.rb
thecore_settings-3.0.6 lib/thecore_settings/fallback.rb
thecore_settings-3.0.5 lib/thecore_settings/fallback.rb
thecore_settings-3.0.4 lib/thecore_settings/fallback.rb
thecore_settings-3.0.3 lib/thecore_settings/fallback.rb
thecore_settings-3.0.0 lib/thecore_settings/fallback.rb
thecore_settings-2.0.8 lib/thecore_settings/fallback.rb
thecore_settings-2.0.7 lib/thecore_settings/fallback.rb
thecore_settings-2.0.6 lib/thecore_settings/fallback.rb
thecore_settings-2.0.5 lib/thecore_settings/fallback.rb
thecore_settings-2.0.4 lib/thecore_settings/fallback.rb
thecore_settings-2.0.3 lib/thecore_settings/fallback.rb
thecore_settings-2.0.2 lib/thecore_settings/fallback.rb