Class: DOM::FileReader

Inherits:
Object show all
Includes:
Events
Defined in:
opal/fron/dom/file_reader.rb

Overview

File Reader

Instance Attribute Summary

Attributes included from Events

#listeners

Instance Method Summary collapse

Methods included from Events

#addListener, #delegate, #off, #on, #on!, #removeListeners, #trigger

Constructor Details

#initializeFileReader

Initialzies the fire reader


7
8
9
# File 'opal/fron/dom/file_reader.rb', line 7

def initialize
  @el = `new FileReader()`
end

Instance Method Details

#readAsDataURL(file) ⇒ Object

Read the given file as data url

Parameters:

  • file (Native)

    The file


14
15
16
17
# File 'opal/fron/dom/file_reader.rb', line 14

def readAsDataURL(file)
  return unless file
  `#{@el}.readAsDataURL(file.native)`
end