Method: Browser::Blob#rename

Defined in:
opal/browser/blob.rb

#rename(new_filename) ⇒ File

Rename a blob and return a File with a new name.

Returns:

  • (File)

    a renamed blob



69
70
71
72
73
# File 'opal/browser/blob.rb', line 69

def rename(new_filename)
  File.create([self], new_filename, type: type, 
                                    lastModified: respond_to?(:last_modified) ? 
                                                    last_modified : Time.now)
end