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.
269 270 271 |
# File 'lib/dommy/streams.rb', line 269 def initialize(stream) @stream = stream end |
Instance Method Details
#__js_call__(method, args) ⇒ Object
287 288 289 290 291 292 293 294 295 296 |
# File 'lib/dommy/streams.rb', line 287 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
281 282 283 |
# File 'lib/dommy/streams.rb', line 281 def abort(reason = nil) @stream.__internal_abort__(reason) end |
#close ⇒ Object
277 278 279 |
# File 'lib/dommy/streams.rb', line 277 def close @stream.__internal_close__ end |
#write(chunk) ⇒ Object
273 274 275 |
# File 'lib/dommy/streams.rb', line 273 def write(chunk) @stream.__internal_write__(chunk) end |