mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-13 10:14:58 +02:00
Fixes spacing issues
This commit is contained in:
@@ -173,9 +173,9 @@ new_hash.keys #=> [:defcon, :action]
|
|||||||
if true
|
if true
|
||||||
"if statement"
|
"if statement"
|
||||||
elsif false
|
elsif false
|
||||||
"else if, optional"
|
"else if, optional"
|
||||||
else
|
else
|
||||||
"else, also optional"
|
"else, also optional"
|
||||||
end
|
end
|
||||||
|
|
||||||
for counter in 1..5
|
for counter in 1..5
|
||||||
@@ -190,7 +190,8 @@ end
|
|||||||
# HOWEVER, No-one uses for loops.
|
# HOWEVER, No-one uses for loops.
|
||||||
# Instead you should use the "each" method and pass it a block.
|
# Instead you should use the "each" method and pass it a block.
|
||||||
# A block is a bunch of code that you can pass to a method like "each".
|
# A block is a bunch of code that you can pass to a method like "each".
|
||||||
# It is analogous to lambdas, anonymous functions or closures in other programming languages.
|
# It is analogous to lambdas, anonymous functions or closures in other
|
||||||
|
# programming languages.
|
||||||
#
|
#
|
||||||
# The "each" method of a range runs the block once for each element of the range.
|
# The "each" method of a range runs the block once for each element of the range.
|
||||||
# The block is passed a counter as a parameter.
|
# The block is passed a counter as a parameter.
|
||||||
|
Reference in New Issue
Block a user