Adds an upon rule that works by delegation if the value responds to `method`.

 Example:

     Myrrha.coercions do |r|
       r.delegate(:to_foo)

       # is a shortcut for
       r.upon(lambda{|v,_| v.respond_to?(:to_foo)}){|v,_| v.to_foo}
     end
775350
def delegate(method, &convproc)
      convproc ||= lambda{|v,t| v.send(method) }
      upon(lambda{|v,t| v.respond_to?(method) }, convproc)
    end
1139581
function atrule(toks, i, n, handler, blockok) {
    var start = i++;
    while (i < n && toks[i] !== '{' && toks[i] !== ';') {
      ++i;
    }
    if (i < n && (blockok || toks[i] === ';')) {
      var s = start+1, e = i;
      if (s < n && toks[s] === ' ') { ++s; }
      if (e > s && toks[e-1] === ' ') { --e; }
      if (handler['startAtrule']) {
        handler['startAtrule'](toks[start].toLowerCase(), toks.slice(s, e));
      }
      i = (toks[i] === '{')
          ? block(toks, i, n, handler)
          : i+1;  // Skip over ';'
      if (handler['endAtrule']) {
        handler['endAtrule']();
      }
    }
    // Else we reached end of input or are missing a semicolon.
    // Drop the rule on the floor.
    return i;
  }
12365
def respond_to? method, include_private=false
      attribute = self.meta_attributes.select { |x| method.match /^#{x}(_id)?=?$/ }.pop
      if attribute
        self.class.find_object_from(attribute) ? true : !method.match(/^#{attribute}=?$/).nil?
      else
        super
      end
    end
388096
def _addMethod(self, effect, verb, resource, conditions):
        """"""
        if verb != "*" and not hasattr(HttpVerb, verb):
            raise NameError("Invalid HTTP verb " + verb + ". Allowed verbs in HttpVerb class")
        resourcePattern = re.compile(self.pathRegex)
        if not resourcePattern.match(resource):
            raise NameError("Invalid resource path: " + resource + ". Path should match " + self.pathRegex)

        if resource[:1] == "/":
            resource = resource[1:]

        resourceArn = ("arn:aws:execute-api:" +
            self.region + ":" +
            self.awsAccountId + ":" +
            self.restApiId + "/" +
            self.stage + "/" +
            verb + "/" +
            resource)

        if effect.lower() == "allow":
            self.allowMethods.append({
                'resourceArn' : resourceArn,
                'conditions' : conditions
            })
        elif effect.lower() == "deny":
            self.denyMethods.append({
                'resourceArn' : resourceArn,
                'conditions' : conditions
            })
956476
def method_missing(method, *args, &block)
      if controller.resource_named_route_helper_method?(method)
        self.class.send(:delegate, method, :to => :controller)
        controller.send(method, *args)
      else
        super(method, *args, &block)
      end
    end
52558
function (el, ev, callback, selector) {
		return selector ?
			delegate(el, selector.trim(), ev, callback) :
			bind(el, ev, callback);
	}
257887
def delegate(attribute_name, method_names):
    
    call_attribute_method = partial(_call_delegated_method, attribute_name)

    def decorate(class_):
        for method in method_names:
            setattr(class_, method, partialmethod(call_attribute_method, method))

        return class_
    return decorate
654862
private void callHandleMethod(Method method, Object instance, ApiZone apiZone,
            Object userAgent) {
        ReflectMethodUtil.invokeHandleMethod(method, instance, context, apiZone, userAgent);
    }
407147
private <T extends SeleniumAction> T action(T delegate) {
        if (seleniumBrowser != null) {
            delegate.setBrowser(seleniumBrowser);
        }

        action.setDelegate(delegate);
        return delegate;
    }
1234178
function delegateMethod(target, parseArgs, args) {
    var params = parseArgs(args);

    params.filters.unshift(createExcludeNameFilter(/^_/));
    params.filters.push(delegateFilter);

    return params;
}
767117
def method_missing(method, *args, &block)
      return super unless delegatable?(method)

      self.class.delegate method
      send(method, *args, &block)
    end
662117
def bind(cls, param=None, **kwargs):
        
        def stick(function, **binding):
            if not asyncio.iscoroutine(function):
                function = asyncio.coroutine(function)
            bindings = getattr(function, STICKER, [])
            bindings.append(binding)
            setattr(function, STICKER, bindings)
            return function
        if isinstance(param, str):
            return partial(stick, prefix=param, **kwargs)
        return stick(param, **kwargs)
1077660
@Override
    @SuppressWarnings({ "unchecked" })
    public boolean perform(TherianContext context, final Convert<?, ?> convert) {
        return new Delegate(convert).perform(context, convert);
    }
589930
def delegate(attribute_name, method_names):
    """"""
    # hack for python 2.7 as nonlocal is not available
    info = {
        'attribute': attribute_name,
        'methods': method_names
    }

    def decorator(cls):
        """Decorate class."""
        attribute = info['attribute']
        if attribute.startswith("__"):
            attribute = "_" + cls.__name__ + attribute
        for name in info['methods']:
            setattr(cls, name, eval("lambda self, *a, **kw: "
                                    "self.{0}.{1}(*a, **kw)".format(attribute, name)))
        return cls
    return decorator
321040
def respond_to?(method_name, _include_all = false)
      if attrs.key?(method_name.to_s)
        true
      else
        super(method_name)
      end
    end
179104
def respond_to?(method_name, include_private=false)
      camelized_name = camelize(method_name.to_s)

      if key?(method_name) ||
          key?(camelized_name) ||
            method_name.to_s.slice(/[=?!_]\Z/)
        return true
      end

      super
    end
1098631
def _delegate(from_owner, to_owner, method):
  
  dgate = lambda self, *args, **kwargs: getattr(getattr(self, to_owner), method)(*args, **kwargs)
  dgate.__name__ = method
  dgate.__doc__ = "Delegates to {0}.{1}: {2}".format(to_owner, method, method.__doc__)
  setattr(from_owner, method, dgate)