Why is “❨╯°□°❩╯︵┻━┻” with such an encoding used for a method name?

≡放荡痞女 提交于 2019-12-03 10:49:55

问题


I came across following method in sidekiq gem. Its just invoked from test_sidekiq.rb.

def self.❨╯°□°❩╯︵┻━┻
  puts "Calm down, bro"
end

This is the only link I was able to find on SO.

  1. Google can't understand ❨╯°□°❩╯︵┻━┻. Why doesn't Ruby complain about this encoding?
  2. What is the purpose of this method (not much looking at its body)?
  3. Why did author @mike-perham use this name? Just for fun, or testing some boundaries?

回答1:


If you really do not understand the sense of the method name, that is a (Japanese-style) facemark. Whereas English facemarks are rotated 90 degrees counter-clockwise and are long in the vertical direction of the actual face, Japanese facemarks are to be read in the direction as is, and are long in the horizontal direction. The author of this is likely to be either a Japanese, or someone who is influenced by Japanese culture like anime.

In this particular case, each character expresses a certain part. From left to right:

  • The right edge of the face
  • The right arm raised
  • ° The right eye
  • The mouth
  • ° The left eye
  • The left edge of the face
  • The left arm raised
  • An imaginary curve expressing the trace of a thrown table
  • ┻━┻ A thrown upside-down table (most likely a chabudai that used to be seen typically in Japanese homes until some decades ago)

Chabudai gaeshi used to happen often at some feudal Japanese homes until some decades ago. The father had the absolute monarchic right at home, and whenever he was frustrated over something, he would flip the chabudai during dinner to show his anger, and the family (especially the mother) had to prepare the dinner again.

Here are more variations.




回答2:


It's a core part of the Sidekiq API. Sidekiq is limited to only tables while Sidekiq Pro adds APIs to flip other types of furniture: chairs, ottomans, loveseats, etc.




回答3:


Looking at the commit that introduced it seems to be some funny sort way to make sure the file is encoded in UTF-8

https://github.com/mperham/sidekiq/commit/c1127165f8157807e7855c60f9849d20fb9fec24



来源:https://stackoverflow.com/questions/23975346/why-is-with-such-an-encoding-used-for-a-method-name

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!