Hiromichi NOMATA
May 26, 2020
140

# Ruby 2.7クイズ / Ruby 2.7 Quiz

May 26, 2020

## Transcript

2. ### ύλʔϯϚον case {a: 0, b: 1, c: 2} in {a:

0, i: 1} puts 1 in {a: 0, b: tmp} puts 2 in {a: 0, b: 1, c: tmp} puts 3 in {a: 0, b: 1, c: 2} puts 4 end ग़ྗ͞ΕΔจࣈ͸?
3. ### ύλʔϯϚον case {a: 0, b: 1, c: 2} in {a:

0, i: 1} puts 1 in {a: 0, b: tmp} puts 2 in {a: 0, b: 1, c: tmp} puts 3 in {a: 0, b: 1, c: 2} puts 4 end ౴͑: 2

౴͑: શ෦
6. ### ΩʔϫʔυҾ਺ͱͯ͠ڐ༰͞Ε Δͷ͸? 1. def foo(h, **kw); end; foo(key: 42) 2.

def foo(h, key: 42); end; foo(key: 42) 3. def foo(**kw); end; foo({key: 42}) 4. def foo(h, key: 42); end; foo({key: 42})
7. ### ΩʔϫʔυҾ਺ͱͯ͠ڐ༰͞Ε Δͷ͸? 1. def foo(h, **kw); end; foo(key: 42) 2.

def foo(h, key: 42); end; foo(key: 42) 3. def foo(**kw); end; foo({key: 42}) 4. def foo(h, key: 42); end; foo({key: 42}) =>

C17

C17

11. ### ूܭϝιου ["a", "b", "c", "b"].xxx #=> {"a"=>1, "b"=>2, "c"=>1} 1.

count_map 2. sum_map 3. pally 4. tally
12. ### ूܭϝιου ["a", "b", "c", "b"].xxx #=> {"a"=>1, "b"=>2, "c"=>1} 1.

count_map 2. sum_map 3. pally 4. tally

14. ### ൪߸ࢦఆύϥϝλʔ [1,4,3].map{puts xxx} # => 1 4 3 1. _0

2. _1 3. \$0 4. \$1
15. ### ൪߸ࢦఆύϥϝλʔ 1. _0 2. _1 3. \$0 4. \$1 [1,4,3].map{puts

xxx} # => 1 4 3