summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorPratik Karki <predatoramigo@gmail.com>2017-09-06 00:46:21 +0545
committerGitHub <noreply@github.com>2017-09-06 00:46:21 +0545
commit3c28b2c360eed60057ab668361afa872c38168bb (patch)
treeeff44c9ac31e42311073b08a825c8f4427de7c3a
parent29e1470400dfcd6ad588c496cea955b6fb55f3a3 (diff)
parent836133b871e6a8b75a5aed2d69f7099b1bc8971e (diff)
Merge pull request #2834 from wwalker/master
[ruby/en_us] Ruby has "methods" not "functions"
-rw-r--r--ruby.html.markdown6
1 files changed, 3 insertions, 3 deletions
diff --git a/ruby.html.markdown b/ruby.html.markdown
index a1532855..e0a6bb6e 100644
--- a/ruby.html.markdown
+++ b/ruby.html.markdown
@@ -359,13 +359,13 @@ ensure
puts 'This code always runs no matter what'
end
-# Functions
+# Methods
def double(x)
x * 2
end
-# Functions (and all blocks) implicitly return the value of the last statement
+# Methods (and all blocks) implicitly return the value of the last statement
double(2) #=> 4
# Parentheses are optional where the result is unambiguous
@@ -399,7 +399,7 @@ surround { puts 'hello world' }
# }
-# You can pass a block to a function
+# You can pass a block to a method
# "&" marks a reference to a passed block
def guests(&block)
block.call 'some_argument'