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>,
);
}
github.com/WebAssembly/wasi-http/blob/d163277b8684483a2334363ca1492ca298ea526d/wit/types.wit#L437
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 |