Sha256: 7541c920a4aed25c6981ece2d2ee5c7bb4fc6de480195b6fccf525d24efbda7f
Contents?: true
Size: 733 Bytes
Versions: 2
Compression:
Stored size: 733 Bytes
Contents
module Eco module Language module Methods module DelegateMissing def delegate_missing_to(meth) @delegate_missing_to = meth end def method_missing(method_name, *args, **kargs, &block) super unless (receiver = object_missing_delegated_to) receiver.send(method_name, *args, **kargs, &block) end def respond_to_missing?(method_name, include_private = false) super end private # retrieve the delegate_missing_to object def object_missing_delegated_to return unless @delegate_missing_to method(@delegate_missing_to).call end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
eco-helpers-3.0.21 | lib/eco/language/methods/delegate_missing.rb |
eco-helpers-3.0.20 | lib/eco/language/methods/delegate_missing.rb |