Sha256: 15b3aa9026ce91327226dcd301ec2ecb5327a3e82fe001b92faf65f1dcb59dd7

Contents?: true

Size: 426 Bytes

Versions: 8

Compression:

Stored size: 426 Bytes

Contents

module RailsAdminSettings
  # 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
      "#<RailsAdminSettings::Fallback ns: #{@ns.inspect}, fb: #{@fb.inspect}>"
    end

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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rails_admin_settings-0.6.8 lib/rails_admin_settings/fallback.rb
rails_admin_settings-0.6.7 lib/rails_admin_settings/fallback.rb
rails_admin_settings-0.6.5 lib/rails_admin_settings/fallback.rb
rails_admin_settings-0.6.4 lib/rails_admin_settings/fallback.rb
rails_admin_settings-0.6.3 lib/rails_admin_settings/fallback.rb
rails_admin_settings-0.6.2 lib/rails_admin_settings/fallback.rb
rails_admin_settings-0.6.1 lib/rails_admin_settings/fallback.rb
rails_admin_settings-0.6.0 lib/rails_admin_settings/fallback.rb