SDKs
Ruby SDK
The official Wayline SDK for Ruby: Ruby 2.6+. Standard library Net::HTTP, no runtime dependencies.
Install
bundle add wayline
# or: gem install waylineQuickstart
Set WAYLINE_API_KEY to a test key (see the Quickstart), then:
require "wayline"
client = Wayline::Client.new(api_key: ENV.fetch("WAYLINE_API_KEY"))
d = client.distance(origin: [23.7925, 90.4078], destination: "23.733,90.4172", units: "imperial")
puts d["distance_miles"], d["duration_seconds"]
m = client.matrix(origins: [[23.7925, 90.4078]], destinations: [[23.733, 90.4172]])
puts m["rows"][0]["elements"][0]["duration_seconds"]Errors
Non-2xx responses raise a typed error after retries are exhausted. Branch on code — the full list is in the error reference.
begin
client.distance(origin: "0,0", destination: "0,1")
rescue Wayline::Error => e
puts e.code, e.status, e.request_id
endConfiguration
| Option | Default | Description |
|---|---|---|
| API key | WAYLINE_API_KEY | Your live or test key. Never logged. |
| Base URL | https://api.wayline.cloud | Override for staging or a proxy. |
| Timeout | 30 seconds | Per attempt. |
| Max retries | 3 | For 429 and 5xx, with exponential backoff + jitter, honoring Retry-After. |
Source and releases
Package: wayline on RubyGems. Source: packages/sdk-ruby. Versions follow semantic versioning; see the CHANGELOG in the package and our product changelog.