ah, I got it. Since everything in ruby is an object. So, if I do self ===, it will be equal to self.===, hence it will call the approriate method for the object self which is a string here. On the other hand, if I do /\A\d\z/.===, it will call "another kind" of === method since the object here is an regex.
Thanks very much, and have a nice day.
great
explicit is better than implicit.
spoiler flag, plz...
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
how does it work? Any documentation that support this assumtion... =)
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Like my solution :)
This comment is hidden because it contains spoiler information about the solution
elreyatee 19 Style...disclaimer number could change anytime...!! :)
Yeah, String methods weren't allowed!
Yes, I also thought the same think. This solution absolutely is using string operation.
ah, I got it. Since everything in ruby is an object. So, if I do self ===, it will be equal to self.===, hence it will call the approriate method for the object self which is a string here. On the other hand, if I do /\A\d\z/.===, it will call "another kind" of === method since the object here is an regex.
Thanks very much, and have a nice day.
no 'self ===' it is String method === , '/\A\d\z/ ===' it is Regexp method ===
Loading more items...