正如您所见,类方法非常简单。
确保只有一行是父类方法调用。
Make sure that there is only one line that is a super method invocation.
现在让我们添加形成DSL的类方法。
这也适用于函数,甚至是类方法,如下所示。
The same concept can be used with functions, or even class methods, as shown below.
这是另一个类方法。
因此我决定创建一个类方法来封装上面的行为。
I decided to create a class method that would encapsulate the above behavior.
Ruby还包括另外一个方便的DSL机制:alias_method类方法。
Ruby also includes another handy DSL mechanism: the alias_method class method.
这些类将为用户提供获取成员数据的方法。
这些类将为用户提供设置成员数据的方法。
这些类将为用户提供设置和(或)获取成员数据的方法。
They provide the user with methods that set and/or get member data.
简单地说,方法是在类中声明的函数。
社会科学的研究方法生成两类数据。
The research methods of social science generate two kinds of data.
随着本文的继续展开,我们将构建这个类的方法。
We will be building up the methods of this class as the article proceeds.
包:类和方法调用上下文属于的包。
Package: the package where the class and method invocation, in context, belong to.
增强某个类的方法有多种(请参见参考资料)。
在添加新控制器类或方法之后,它们就自动变为可用的了。
Once you add a new controller class or method, it becomes automatically available.
face类的方法访问相应形状的属性。
The methods of the Face class access the properties of the corresponding shape.
正号(+)表明一个类或静态方法。
一个Action的操作是目标类的方法。
调用超类的init方法。
对象、类文件,和方法名称。
回想一下,vector类的方法几乎都是同步的。
Recall that the methods of the Vector class are nearly all synchronized.
它不能用于分隔类ID与方法ID。
It cannot be used to separate the class ID from the method ID.
存根类包含远程对象的方法签名。
The stub class contains method signatures of the remote object.
此代码定义为watchit类的静态方法。
This code is defined as the static method of the watchit class.
SlotMachine类的play方法实现是这样的
The play method implementation of the drw.SlotMachine class looks like this
ifsfile类提供的方法在文件上整体运行。
The IFSFile class provides methods that operate on a file as a whole.
进一步精确地确定哪个包、类或者方法导致了问题的发生。
Drill down further to determine exactly which package, class, or method is causing a problem.
我将在本文分别展示这些类中的每个方法。
I will present the individual methods of these classes as separate listings in this article.
随后,令牌被传递至Subject类的login()方法。
Then the token is passed into the Subject class' login() method.
应用推荐