Search code examples
rubycommentsspecial-characters

Can we add special characters inside comments of ruby files?


Need to add flow of my code in comments at the starting of class. Found some symbols here.

I did something like this inside my .rb file.

=begin
A
⬇
B
⬇
C
=end

It is not giving me any error but I need to be sure. Is it safe ? Nothing should happen on deployment day :P


Solution

  • Ruby permits defining source file encoding.

    If your characters are valid in that encoding, you should be fine.