⟩ Tell me how would you freeze an object in Ruby? Can you provide a simple example?
Sometimes it can be useful to prevent an object from being changed. This can be accomplished using the freeze method (Object.freeze) as in the sample code below.
water.freeze
if( water.frozen? )
puts "Water object is a frozen object"
else
puts "Water object is a normal object"
end