Class: Pytty::Client::Api::Spawn
- Inherits:
-
Object
- Object
- Pytty::Client::Api::Spawn
- Defined in:
- lib/pytty/client/api/spawn.rb
Class Method Summary collapse
Class Method Details
.run(id:, tty:, interactive:) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/pytty/client/api/spawn.rb', line 5 def self.run(id:, tty:, interactive:) internet = Async::HTTP::Internet.new headers = [['accept', 'application/json']] body = { tty: tty, interactive: interactive }.to_json response = internet.post("#{Pytty::Client.host_url}/v1/spawn/#{id}", headers, [body]) [response, JSON.parse(response.read)] ensure internet.close end |