Languages
Ruby
The Ruby SDK publishes to RubyGems.
Install
bash
gem install your-org-api-clientOr in a Gemfile:
ruby
gem "your-org-api-client", "~> 1.0"Options
| Option | Values | Default |
|---|---|---|
| Client style | functions, namespaced, class, class-namespaced | functions |
| Argument style | object, positional | object |
| Namespace | tags, path | tags |
| Doc comments | full, minimal | full |
| File header | omit, include | omit |
| Usage example | full, concise | full |
class fits Ruby's conventions
Ruby consumers expect Acme::Client.new(...). Set Client style to class or class-namespaced for Ruby rather than leaving it on functions.
Package name
Gem names are global and hyphenated by convention. A hyphen implies a namespace, so acme-api suggests Acme::Api:
text
acme-apiYanking a gem doesn't free the version
RubyGems lets you yank a version, which stops new installs, but the version number stays claimed and the name stays yours forever. See Publishing.
What callers write
ruby
require "acme"
client = Acme::Client.new(token: ENV["ACME_TOKEN"])
client.users.list(limit: 100).each do |user|
puts user.id
end