Ruby

Use the Cells HTTP API from Ruby. No published gem exists yet.

Note
No RubyGems package has been published. Use the REST API directly or generate a typed client from the OpenAPI spec.

HTTP example

Ruby (net/http)
require "net/http"
require "json"
require "uri"

project_id = ENV["CELLS_PROJECT_ID"]
api_key    = ENV["CELLS_API_KEY"]
uri        = URI("https://api.mudbase.dev/api/sandboxes/projects/#{project_id}")

req = Net::HTTP::Post.new(uri)
req["x-api-key"]    = api_key
req["Content-Type"] = "application/json"
req.body = JSON.generate(language: "ruby", languageVersion: "3.3", timeoutSeconds: 300)

resp = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
data = JSON.parse(resp.body)
puts data["sessionId"]
require "net/http"
require "json"
require "uri"

project_id = ENV["CELLS_PROJECT_ID"]
api_key    = ENV["CELLS_API_KEY"]
uri        = URI("https://api.mudbase.dev/api/sandboxes/projects/#{project_id}")

req = Net::HTTP::Post.new(uri)
req["x-api-key"]    = api_key
req["Content-Type"] = "application/json"
req.body = JSON.generate(language: "ruby", languageVersion: "3.3", timeoutSeconds: 300)

resp = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
data = JSON.parse(resp.body)
puts data["sessionId"]

Generate a typed client

openapi-generator
openapi-generator-cli generate \
  -i https://docs.cells.mudbase.dev/openapi.yaml \
  -g ruby \
  -o ./cells-client
openapi-generator-cli generate \
  -i https://docs.cells.mudbase.dev/openapi.yaml \
  -g ruby \
  -o ./cells-client