I know ||=, but I have to know more feature of this.
Simple simple
class Smile
attr_accessor :smile
def ensmile
@smile = "SMILE"
e...
For further actions, you may consider blocking this person and/or reporting abuse
(Disclaimer - I've never written Ruby, but I'm assuming || is logical or - a || b is a if a is true, otherwise b)
I believe that ||= might not work very well if you try to memoize
false
.The point of memoization is that once a value is set, you don't change it:
Consider a boolean property instead:
And test that criers never smile:
thank you. I'll check and fix.😃