* doc/syntax/calling_methods.rdoc: Link to defining methods.
* doc/syntax/methods.rdoc: Link to calling methods, fixed typo. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8113321482
commit
4cf9fa309d
@ -1,3 +1,8 @@
|
|||||||
|
Wed Jan 16 03:28:47 2013 Eric Hodel <drbrain@segment7.net>
|
||||||
|
|
||||||
|
* doc/syntax/calling_methods.rdoc: Link to defining methods.
|
||||||
|
* doc/syntax/methods.rdoc: Link to calling methods, fixed typo.
|
||||||
|
|
||||||
Wed Jan 16 03:15:00 2013 Eric Hodel <drbrain@segment7.net>
|
Wed Jan 16 03:15:00 2013 Eric Hodel <drbrain@segment7.net>
|
||||||
|
|
||||||
* doc/syntax/methods.rdoc: Fixed link
|
* doc/syntax/methods.rdoc: Fixed link
|
||||||
|
@ -13,6 +13,9 @@ Note that the parenthesis are optional:
|
|||||||
Except when there is difference between using and omitting parentheses, this
|
Except when there is difference between using and omitting parentheses, this
|
||||||
document uses parenthesis when arguments are present to avoid confusion.
|
document uses parenthesis when arguments are present to avoid confusion.
|
||||||
|
|
||||||
|
This section only covers calling methods. See also the {syntax documentation
|
||||||
|
on defining methods}[rdoc-ref:syntax/methods.rdoc].
|
||||||
|
|
||||||
== Receiver
|
== Receiver
|
||||||
|
|
||||||
+self+ is the default receiver. If you don't specify any receiver +self+ will
|
+self+ is the default receiver. If you don't specify any receiver +self+ will
|
||||||
|
@ -11,6 +11,9 @@ A method definition consists of the +def+ keyword, a method name, the body of
|
|||||||
the method, then the +end+ keyword. When called the method will execute the
|
the method, then the +end+ keyword. When called the method will execute the
|
||||||
body of the method. This method returns +2+.
|
body of the method. This method returns +2+.
|
||||||
|
|
||||||
|
This section only covers defining methods. See also the {syntax documentation
|
||||||
|
on calling methods}[rdoc-ref:syntax/calling_methods.rdoc].
|
||||||
|
|
||||||
== Method Names
|
== Method Names
|
||||||
|
|
||||||
Method names may be one of the operators or must start a letter or a character
|
Method names may be one of the operators or must start a letter or a character
|
||||||
@ -69,7 +72,7 @@ operators.
|
|||||||
<code>>=</code> :: greater-than or equal
|
<code>>=</code> :: greater-than or equal
|
||||||
|
|
||||||
To define unary methods minus, plus, tilde and not (<code>!</code>) follow the
|
To define unary methods minus, plus, tilde and not (<code>!</code>) follow the
|
||||||
operator with an <code>@</code> as in <code>+@</code> or <code>!@<code>:
|
operator with an <code>@</code> as in <code>+@</code> or <code>!@</code>:
|
||||||
|
|
||||||
class C
|
class C
|
||||||
def -@
|
def -@
|
||||||
|
Loading…
x
Reference in New Issue
Block a user