In Ruby, what does it mean for a String or Array (etc) object to be ‘Frozen’? How/where is this property set or modified?
In Ruby, what does it mean for a String or Array (etc) object to
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It means you cannot modify it. You set it by
freezemethod.concatmodifies the string instance.When you freeze the string:
then, you cannot apply
concatany more.However, you can apply methods that do not modify the receiver: