This repository was archived by the owner on Jun 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 213
module ShopifyCli::MethodObject::ClassMethods
Kevin O'Sullivan edited this page Jun 28, 2021
·
3 revisions
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 67
def call(*args, **kwargs, &block)
properties.keys.yield_self do |properties|
new(**kwargs.slice(*properties))
.call(*args, **kwargs.slice(*(kwargs.keys - properties)), &block)
end
endto_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 78
def to_proc
method(:call).to_proc
end