Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

module ShopifyCli::MethodObject::ClassMethods

Kevin O'Sullivan edited this page Jun 28, 2021 · 3 revisions

Instance Methods

call

call(*args, **kwargs, &block) creates a new instance and invokes call. Any positional argument is forward to call. Keyword arguments are either forwarded to the initializer or to call. If the keyword argument matches the name of property, it is forwarded to the initializer, otherwise to call.

see source

# File lib/shopify-cli/method_object.rb, line 67defcall(*args, **kwargs, &block)properties.keys.yield_selfdo |properties|
new(**kwargs.slice(*properties)).call(*args, **kwargs.slice(*(kwargs.keys - properties)), &block)endend

to_proc

to_proc() returns a proc that invokes call with all arguments it receives when called itself.

see source

# File lib/shopify-cli/method_object.rb, line 78defto_procmethod(:call).to_procend

Clone this wiki locally