Sha256: 1154ca4fa7e41b43df82d8fd3a40d238f76b200e358d2521d7da5852be744e80
Contents?: true
Size: 443 Bytes
Versions: 14
Compression:
Stored size: 443 Bytes
Contents
module Invokr Invocation = Struct.new :method, :positional_args, :keyword_args, :block_arg do def invoke! obj if block_arg? obj.public_send method, *args, &block_arg else obj.public_send method, *args end end def block_arg? block_arg ? true : false end def args args = positional_args.dup args << keyword_args unless keyword_args.empty? args end end end
Version data entries
14 entries across 14 versions & 1 rubygems