This repository has been archived by the owner on Jun 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 205
module ShopifyCli::MethodObject::ClassMethods
Konstantin Tennhard edited this page Feb 2, 2021
·
3 revisions
call(*args, **kwargs)
creates a new instance and invokes call
. Any positional argument is forward
to call
. Keyword arguments are either forwarded to the inializer 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)
properties.keys.yield_self do |properties|
new(**kwargs.slice(*properties))
.call(*args, **kwargs.slice(*(kwargs.keys - properties)))
end
end
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 78
def to_proc
method(:call).to_proc
end