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



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

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

#nameString (readonly)

Returns filename.

Returns:



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

def name
  `#@native.name`
end

Class Method Details

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

Create a new file from anything that File API supports



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

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