Class: Opal::RSpec::DocumentIO
- Inherits:
-
IO
- Object
- IO
- Opal::RSpec::DocumentIO
- Includes:
- IO::Writable
- Defined in:
- opal/opal/rspec/formatter/document_io.rb
Instance Method Summary collapse
- #close ⇒ Object
- #flush ⇒ Object
-
#initialize ⇒ DocumentIO
constructor
A new instance of DocumentIO.
- #write(html) ⇒ Object
Constructor Details
#initialize ⇒ DocumentIO
Returns a new instance of DocumentIO.
6 7 8 |
# File 'opal/opal/rspec/formatter/document_io.rb', line 6 def initialize `document.open();` end |
Instance Method Details
#close ⇒ Object
10 11 12 13 |
# File 'opal/opal/rspec/formatter/document_io.rb', line 10 def close @closed = true `document.close()` end |
#flush ⇒ Object
23 24 |
# File 'opal/opal/rspec/formatter/document_io.rb', line 23 def flush end |
#write(html) ⇒ Object
15 16 17 18 19 20 21 |
# File 'opal/opal/rspec/formatter/document_io.rb', line 15 def write(html) if @closed `console.error(#{"DOC closed, can't write #{html}" })` else `document.write(#{html})` end end |