You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -110,7 +110,7 @@ Q: Symbols are immutable objects. Name another immutable core Ruby object.
110
110
A: `Fixnum`
111
111
112
112
Q: What happens when a value is too big for `Fixnum`?
113
-
A: It is automatically converteed to a `Bignum`.
113
+
A: It is automatically converted to a `Bignum`.
114
114
115
115
Q: The superclass of `Fixnum` is __.
116
116
A: `Integer`
@@ -251,7 +251,7 @@ Q: Name two `Enumerable` classes (classes which mix in the `Enumerable` module).
251
251
A: `Array`, `Hash`, `Set`, `Range`, `IO`...
252
252
253
253
Q: When might you use the `do`/`end` syntax versus using the curly bracket syntax for a block?
254
-
A: The `do`/`end` syntax for a block is commonly used for multiline statements. An alternate convention is to use curly bracket syntax for blocks that return a value while using `do`/`end` syntax for blocks that change the state of the system somehow and do not return a value.
254
+
A: The `do`/`end` syntax for a block is commonly used for multi-line statements. An alternate convention is to use curly bracket syntax for blocks that return a value while using `do`/`end` syntax for blocks that change the state of the system somehow and do not return a value.
255
255
256
256
Q: What is an iterator?
257
257
A: An object that allows traversal of the elements of the container. In Ruby, an iterator is any method that uses the yield statement.
@@ -391,7 +391,7 @@ Procs and Lambdas
391
391
Q: What are the two varieties of Proc objects?
392
392
A: Procs and lambdas.
393
393
394
-
Q: How do you accept an associated block within a Proc's paramters list.
394
+
Q: How do you accept an associated block within a Proc's parameters list.
395
395
A: Prefix `&` to the last parameter.
396
396
397
397
Q: What is true about a method argument that is prefixed with `&`?
@@ -403,7 +403,7 @@ A: Calling a lambda is more akin to invoking a method where a return statement i
403
403
Q: Does an object have to be a Proc object for a `&` to be prefixed to it in a parameter list?
404
404
A: No, `&` can appear before any object with a `#to_proc` method.
405
405
406
-
Q: What is the difference between a Proc invocation and a lambda invocaton?
406
+
Q: What is the difference between a Proc invocation and a lambda invocation?
407
407
A: There must be a block associated with lambda invocation. Lambdas must be invoked with the exact number of arguments as is required by method invocation, whereas procs are more flexible in receiving arguments.
0 commit comments