I'm analyzing a bit of how the three equal sign ===
, or case equality method/operator works on Ruby for true, false, TrueClass and FalseClass. And I found this particular behavior/result when evaluating these expressions:
> TrueClass === true
# => true
> true === TrueClass
# => false
I know each object has its own implementation of this, such as string where:
variable === 'abc'
In case of true
would mean, variable matches 'abc' exactly, false
otherwise.
The implementation I see of this in C doesn't really tell me anything as I'm not very familiar with Ruby's C implementation. Here's the link: http://ruby-doc.org/core-2.3.0/TrueClass.html#method-i-3D-3D-3D
Thanks in advance.