Class: Dommy::ReadableStreamDefaultReader
- Inherits:
-
Object
- Object
- Dommy::ReadableStreamDefaultReader
- Includes:
- Bridge::Methods
- Defined in:
- lib/dommy/streams.rb
Overview
Reader returned by getReader().
Instance Method Summary collapse
- #__js_call__(method, args) ⇒ Object
- #cancel(reason = nil) ⇒ Object
-
#initialize(stream) ⇒ ReadableStreamDefaultReader
constructor
A new instance of ReadableStreamDefaultReader.
- #read ⇒ Object
- #release_lock ⇒ Object (also: #releaseLock)
Methods included from Bridge::Methods
Constructor Details
#initialize(stream) ⇒ ReadableStreamDefaultReader
Returns a new instance of ReadableStreamDefaultReader.
171 172 173 |
# File 'lib/dommy/streams.rb', line 171 def initialize(stream) @stream = stream end |
Instance Method Details
#__js_call__(method, args) ⇒ Object
193 194 195 196 197 198 199 200 201 202 |
# File 'lib/dommy/streams.rb', line 193 def __js_call__(method, args) case method when "read" read when "releaseLock" release_lock when "cancel" cancel(args[0]) end end |
#cancel(reason = nil) ⇒ Object
187 188 189 |
# File 'lib/dommy/streams.rb', line 187 def cancel(reason = nil) @stream.cancel(reason) end |
#read ⇒ Object
175 176 177 |
# File 'lib/dommy/streams.rb', line 175 def read @stream.__internal_read__ end |
#release_lock ⇒ Object Also known as: releaseLock
179 180 181 182 183 |
# File 'lib/dommy/streams.rb', line 179 def release_lock # Spec: detaches the reader. We model the stream's `@reader` # slot indirectly via `releaseLock` accessibility. nil end |