lib/danica/variables_holder/variables_builder.rb in danica-2.4.3 vs lib/danica/variables_holder/variables_builder.rb in danica-2.4.4
- old
+ new
@@ -28,16 +28,22 @@
private
def add_setter(name)
instance.send(:define_method, "#{name}=") do |value|
- variables_hash[name.to_sym] = wrap_value(value)
+ if(containers_hash[name.to_sym].try(:container?))
+ containers_hash[name.to_sym].content = wrap_value(value)
+ else
+ value = wrap_value(value)
+ value = Danica::Wrapper::Container.new value unless value.container?
+ containers_hash[name.to_sym] = value
+ end
end
end
def add_reader(name)
instance.send(:define_method, name) do
- variables_hash[name.to_sym]
+ containers_hash[name.to_sym]
end
end
end
end