Class: Browser::File

Inherits:
Blob show all
Defined in:
opal/browser/blob.rb

Instance Attribute Summary collapse

Attributes inherited from Blob

#size, #type

Class Method Summary collapse

Methods inherited from Blob

#buffer, #rename, #slice, #text, #to_url

Methods included from NativeCachedWrapper

#restricted?, #set_native_reference

Instance Attribute Details

#last_modifiedTime (readonly)

Returns last modified date of this file.

Returns:

  • (Time)

    last modified date of this file


83
84
85
# File 'opal/browser/blob.rb', line 83

def last_modified
  Time.at(`#@native.lastModified`/1000.0)
end

#nameString (readonly)

Returns filename.

Returns:


89
90
91
# File 'opal/browser/blob.rb', line 89

def name
  `#@native.name`
end

Class Method Details

.create(from, name, options = {}) ⇒ Object

Create a new file from anything that File API supports


77
78
79
# File 'opal/browser/blob.rb', line 77

def self.create(from, name, options={})
  new(`new File(#{Native.convert(from)}, #{name}, #{options.to_n})`)
end