aboutsummaryrefslogtreecommitdiffstats
path: root/doc/syntax/calling_methods.rdoc
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-18 03:39:49 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-18 03:39:49 +0000
commit4f94cb43fcf7035e7ee1db0ba6750d3249567085 (patch)
tree8dea211a4bc465a4936d38f74507edce2d8bdc7b /doc/syntax/calling_methods.rdoc
parentb7d153699153629f037a059b930d8e928c42a4a1 (diff)
downloadruby-4f94cb43fcf7035e7ee1db0ba6750d3249567085.tar.gz
* doc/syntax/*.rdoc: separated modifier at sentence.
[ci skip][fix GH-1121] Patch by @clandry94 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53182 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'doc/syntax/calling_methods.rdoc')
-rw-r--r--doc/syntax/calling_methods.rdoc21
1 files changed, 10 insertions, 11 deletions
diff --git a/doc/syntax/calling_methods.rdoc b/doc/syntax/calling_methods.rdoc
index 99ec48af40..f1ebf186f7 100644
--- a/doc/syntax/calling_methods.rdoc
+++ b/doc/syntax/calling_methods.rdoc
@@ -66,7 +66,7 @@ The positional arguments for the message follow the method name:
my_method(argument1, argument2)
-In many cases parenthesis are not necessary when sending a message:
+In many cases, parenthesis are not necessary when sending a message:
my_method argument1, argument2
@@ -88,7 +88,7 @@ hash-type arguments are assigned as a single hash to the last argument:
my_method('a' => 1, b: 2) # prints: {'a'=>1, :b=>2}
-If too many positional arguments are given an ArgumentError is raised.
+If too many positional arguments are given, an ArgumentError is raised.
=== Default Positional Arguments
@@ -250,8 +250,8 @@ Both are equivalent to:
my_method(1, 2, 3)
-If the method accepts keyword arguments the splat operator will convert a hash
-at the end of the array into keyword arguments:
+If the method accepts keyword arguments, the splat operator will convert a
+hash at the end of the array into keyword arguments:
def my_method(a, b, c: 3)
end
@@ -263,7 +263,7 @@ You may also use the <code>**</code> (described next) to convert a Hash into
keyword arguments.
If the number of objects in the Array do not match the number of arguments for
-the method an ArgumentError will be raised.
+the method, an ArgumentError will be raised.
If the splat operator comes first in the call, parentheses must be used to
avoid a warning.
@@ -290,7 +290,7 @@ Both are equivalent to:
my_method(first: 3, second: 4, third: 5)
If the method definition uses <code>**</code> to gather arbitrary keyword
-arguments they will not be gathered by <code>*</code>:
+arguments, they will not be gathered by <code>*</code>:
def my_method(*a, **kw)
p arguments: a, keywords: kw
@@ -302,7 +302,7 @@ Prints:
{:arguments=>[1, 2, {"3"=>4}], :keywords=>{:five=>6}}
-Unlike the splat operator described above the <code>**</code> operator has no
+Unlike the splat operator described above, the <code>**</code> operator has no
commonly recognized name.
=== Proc to Block Conversion
@@ -323,12 +323,12 @@ operator:
If the splat operator comes first in the call, parenthesis must be used to
avoid a warning.
-Unlike the splat operator described above the <code>&</code> operator has no
+Unlike the splat operator described above, the <code>&</code> operator has no
commonly recognized name.
== Method Lookup
-When you send a message Ruby looks up the method that matches the name of the
+When you send a message, Ruby looks up the method that matches the name of the
message for the receiver. Methods are stored in classes and modules so method
lookup walks these, not the objects themselves.
@@ -347,7 +347,6 @@ If no match is found this repeats from the beginning, but looking for
+method_missing+. The default +method_missing+ is BasicObject#method_missing
which raises a NameError when invoked.
-If refinements (an experimental feature) are active the method lookup changes.
+If refinements (an experimental feature) are active, the method lookup changes.
See the {refinements documentation}[rdoc-ref:syntax/refinements.rdoc] for
details.
-