Sha256: 726e54cea28c44bfe4e16402386972d5886df303f0aaae5dee8662ee93846ee5
Contents?: true
Size: 821 Bytes
Versions: 31
Compression:
Stored size: 821 Bytes
Contents
module Schemacop class ScopedEnv def initialize(delegation_object, methods, backup_binding = nil, prefix = nil) @delegation_object = delegation_object @methods = methods @backup_binding = backup_binding @prefix = prefix end ruby2_keywords def method_missing(symbol, *args, &block) symbol = :"#{@prefix}#{symbol}" if @prefix if @methods.include?(symbol) if @delegation_object.respond_to?(symbol) @delegation_object.send(symbol, *args, &block) elsif @backup_binding.respond_to?(symbol) @backup_binding.send(symbol, *args, &block) else super end else super end end def respond_to_missing?(symbol, include_private = false) @methods.include?(symbol) || super end end end
Version data entries
31 entries across 31 versions & 1 rubygems