You could easily just open up the Fixnum class and add a method to print a bar of the appropriate length, as in Listing 3.
您可以打开fixnum类,并添加一个方法来打印出相应长度的柱,如清单3所示。
Next up is instance behavior: I want my User instances to support the ability to list all retweets in order of influence, which means I need to add another method.
接下来是实例行为:我希望我的User实例支持按影响力顺序列出所有转贴的能力,这意味着我需要添加另一个方法。
The example looks up the add method chain.
本例查找add方法链。
应用推荐