3
Ruby Koans: Tại sao phải chuyển đổi danh sách các biểu tượng thành chuỗi
Tôi đang đề cập đến bài kiểm tra này trong about_symbols.rb trong Ruby Koans https://github.com/edgecase/ruby_koans/blob/master/src/about_symbols.rb#L26 def test_method_names_become_symbols symbols_as_strings = Symbol.all_symbols.map { |x| x.to_s } assert_equal true, symbols_as_strings.include?("test_method_names_become_symbols") end # THINK ABOUT IT: # # Why do we convert the list of symbols to strings and then compare # against the …
85
ruby