module Tori
  module Define
    def tori(name)
      name_file_ivar = "@#{name}_file".to_sym

      define_method(name) do
        ivar = instance_variable_get name_file_ivar
        instance_variable_set name_file_ivar, ivar || File.new(self)
      end

      define_method("#{name}=") do |uploader|
        file = File.new(self, uploader)
        instance_variable_set name_file_ivar, file
      end
    end
  end
end

module Tori
  module Define
    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)
      end

      define_method("#{name}=") do |uploader|
        file = File.new(self, uploader)
        instance_variable_set name_ivar, file
      end
    end
  end
end

Rename ivar to simple name.
Rename ivar to simple name.
