Sha256: eecfd46f4261a4cde9696975280536719de3942f1ae9dd92a979238c792211ef

Contents?: true

Size: 408 Bytes

Versions: 14

Compression:

Stored size: 408 Bytes

Contents

class ScopedEnv
  def initialize(delegation_object, methods)
    @delegation_object = delegation_object
    @methods = methods
  end

  def method_missing(symbol, *args, &block)
    if @methods.include?(symbol)
      @delegation_object.send(symbol, *args, &block)
    else
      super
    end
  end

  def respond_to_missing?(symbol, include_private = false)
    @methods.include?(symbol) || super
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
schemacop-2.4.7 lib/schemacop/scoped_env.rb
schemacop-2.4.6 lib/schemacop/scoped_env.rb
schemacop-2.4.5 lib/schemacop/scoped_env.rb
schemacop-2.4.4 lib/schemacop/scoped_env.rb
schemacop-2.4.3 lib/schemacop/scoped_env.rb
schemacop-2.4.2 lib/schemacop/scoped_env.rb
schemacop-2.4.1 lib/schemacop/scoped_env.rb
schemacop-2.4.0 lib/schemacop/scoped_env.rb
schemacop-2.3.2 lib/schemacop/scoped_env.rb
schemacop-2.3.1 lib/schemacop/scoped_env.rb
schemacop-2.3.0 lib/schemacop/scoped_env.rb
schemacop-2.2.0 lib/schemacop/scoped_env.rb
schemacop-2.1.0 lib/schemacop/scoped_env.rb
schemacop-2.0.0 lib/schemacop/scoped_env.rb