Class: Rack::WASI::ResponseOutparam
- Inherits:
-
Object
- Object
- Rack::WASI::ResponseOutparam
- Defined in:
- lib/rack/wasi/incoming_handler.rb
Overview
resource response-outparam { set: static func( param: response-outparam, response: result<outgoing-response, error-code>, ); }
Instance Method Summary collapse
-
#initialize(js_object_id) ⇒ ResponseOutparam
constructor
We use a reference to the global JS object to access the incoming request data.
- #set(result) ⇒ Object
Constructor Details
#initialize(js_object_id) ⇒ ResponseOutparam
We use a reference to the global JS object to access the incoming request data
83 84 85 |
# File 'lib/rack/wasi/incoming_handler.rb', line 83 def initialize(js_object_id) @js_object = ::JS.global[js_object_id] end |
Instance Method Details
#set(result) ⇒ Object
87 88 89 |
# File 'lib/rack/wasi/incoming_handler.rb', line 87 def set(result) @js_object.call(:set, ::JS::Object.wrap(result)) end |