Commit c1ce182
Add
* Add last to lists
For simplicity, this does not strictly respect Array#last when nil or
false is passed, returning the last element instead of raising a
TypeError.
It also doesn't coerce the parameter into an int with to_int like
Array#last does.
* Update list.rb
Drop defensive programming
* Update list_test.rb
Drop defensive tests
---------
Co-authored-by: David Heinemeier Hansson <dhh@hey.com>last to lists (#97)1 parent a0062d1 commit c1ce182
2 files changed
+14
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
27 | 31 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
44 | 54 | | |
45 | 55 | | |
46 | 56 | | |
| |||
0 commit comments