lib/tori/define.rb in tori-0.0.4 vs lib/tori/define.rb in tori-0.0.5
- old
+ new
@@ -3,10 +3,10 @@
def tori(name)
name_ivar = "@#{name}".to_sym
define_method(name) do
ivar = instance_variable_get name_ivar
- instance_variable_set name_ivar, ivar || File.new(self)
+ ivar || instance_variable_set(name_ivar, File.new(self))
end
define_method("#{name}=") do |uploader|
file = File.new(self, from: uploader)
instance_variable_set name_ivar, file