Extended maintenance of Ruby 1.9.3 ended on February 23, 2015. Read more
# File tk/lib/tk/validation.rb, line 296
def _initialize_for_cb_class(klass, cmd = Proc.new, *args)
extra_args_tbl = klass._get_extra_args_tbl
if args.compact.size > 0
args.map!{|arg| klass._sym2subst(arg)}
args = args.join(' ')
keys = klass._get_subst_key(args)
if cmd.kind_of?(String)
id = cmd
elsif cmd.kind_of?(TkCallbackEntry)
@id = install_cmd(cmd)
else
@id = install_cmd(proc{|*arg|
ex_args = []
extra_args_tbl.reverse_each{|conv| ex_args << conv.call(arg.pop)}
klass.ret_val(cmd.call(
*(ex_args.concat(klass.scan_args(keys, arg)))
))
}) + ' ' + args
end
else
keys, args = klass._get_all_subst_keys
if cmd.kind_of?(String)
id = cmd
elsif cmd.kind_of?(TkCallbackEntry)
@id = install_cmd(cmd)
else
@id = install_cmd(proc{|*arg|
ex_args = []
extra_args_tbl.reverse_each{|conv| ex_args << conv.call(arg.pop)}
klass.ret_val(cmd.call(
*(ex_args << klass.new(*klass.scan_args(keys, arg)))
))
}) + ' ' + args
end
end
end
Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.
If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.
If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.
If you want to help improve the Ruby documentation, please visit Documenting-ruby.org.