lib/vfs/entries/universal_entry.rb in vfs-0.3.14 vs lib/vfs/entries/universal_entry.rb in vfs-0.3.15
- old
+ new
@@ -2,22 +2,21 @@
class UniversalEntry < Entry
#
# Attributes
#
def exist?
- attrs = get
- !!(attrs[:dir] or attrs[:file])
+ !!get
end
#
# CRUD
#
def destroy options = {}
- storage.open_fs do |fs|
+ storage.open do |fs|
attrs = get
- fs.delete_dir path if attrs[:dir]
- fs.delete_file path if attrs[:file]
+ fs.delete_dir path if attrs and attrs[:dir]
+ fs.delete_file path if attrs and attrs[:file]
end
self
end
alias_method :destroy!, :destroy
end
\ No newline at end of file