Class: Dommy::WritableStreamDefaultWriter
- Inherits:
-
Object
- Object
- Dommy::WritableStreamDefaultWriter
- Includes:
- Bridge::Methods
- Defined in:
- lib/dommy/streams.rb
Instance Method Summary collapse
- #__js_call__(method, args) ⇒ Object
- #abort(reason = nil) ⇒ Object
- #close ⇒ Object
-
#initialize(stream) ⇒ WritableStreamDefaultWriter
constructor
A new instance of WritableStreamDefaultWriter.
- #write(chunk) ⇒ Object
Methods included from Bridge::Methods
Constructor Details
#initialize(stream) ⇒ WritableStreamDefaultWriter
Returns a new instance of WritableStreamDefaultWriter.
273 274 275 |
# File 'lib/dommy/streams.rb', line 273 def initialize(stream) @stream = stream end |
Instance Method Details
#__js_call__(method, args) ⇒ Object
291 292 293 294 295 296 297 298 299 300 |
# File 'lib/dommy/streams.rb', line 291 def __js_call__(method, args) case method when "write" write(args[0]) when "close" close when "abort" abort(args[0]) end end |
#abort(reason = nil) ⇒ Object
285 286 287 |
# File 'lib/dommy/streams.rb', line 285 def abort(reason = nil) @stream.__internal_abort__(reason) end |
#close ⇒ Object
281 282 283 |
# File 'lib/dommy/streams.rb', line 281 def close @stream.__internal_close__ end |
#write(chunk) ⇒ Object
277 278 279 |
# File 'lib/dommy/streams.rb', line 277 def write(chunk) @stream.__internal_write__(chunk) end |