... 袋鼠与斑马The Kangaroo and the Zebra 解决问题的方法A Matter of Method 坚持原则的人The Man of Principle ...
基于19个网页-相关网页
Once you've got the resources available to your program, it's just a matter of finding the right method to call. For example, suppose you were using the JSON-PHP module with PHP.
一旦获得了程序可用的资源,剩下的事就是找到合适的方法进行调用。
Affectionately known as "duck typing" (i.e., if it waddles like a duck and quacks like one, then it must be a duck!), polymorphism in Ruby is just a matter of matching method names.
Ruby中的多态性被亲切地称为“duck typing”(意思是,如果它走起路来像鸭子,叫起来也像鸭子,那么它一定是鸭子!),这种多态性只是对方法名进行匹配的问题。
Generally, either method will work, and the choice is often a matter of personal style.
一般而言,两种方法都是有效的,选择哪种方法由您决定。
应用推荐