Module: Wardrobe::Plugins::Immutable::InstanceMethods

Defined in:
lib/wardrobe/plugins/immutable.rb

Instance Method Summary collapse

Instance Method Details

#_attribute_init(atr, hash, name) ⇒ Object



156
157
158
159
# File 'lib/wardrobe/plugins/immutable.rb', line 156

def _attribute_init(atr, hash, name)
  super
  send(atr.name).deep_freeze
end

#initialize(**hash) ⇒ Object



146
147
148
149
150
# File 'lib/wardrobe/plugins/immutable.rb', line 146

def initialize(**hash)
  super
  _data.deep_freeze if instance_variable_defined?(:@_data)
  freeze
end

#mutate(**args, &blk) ⇒ Object



152
153
154
# File 'lib/wardrobe/plugins/immutable.rb', line 152

def mutate(**args, &blk)
  super
end