In Ruby, there is Object#freeze, which prevents further modifications to the object:
class Kingdom attr_accessor :weather_conditions end arendelle = Kingd
frozen_object = %w[hello world].freeze frozen_object.concat(['and universe']) # FrozenError (can't modify frozen Array) frozen_object.dup.concat(['and universe']) # ['hello', 'world', 'and universe']