Skip to content
This repository was archived by the owner on Oct 27, 2023. It is now read-only.

Latest commit

 

History

History

ruby

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Clientele Ruby

A ruby adapter for clientele.

# thing.rb
require 'clientele-api'

Thing = ClienteleApi.new({
  resources: {
    users: {
      get: {
        method: "GET",
        url: "{{{hostname}}}/users/{{id}}",
      },
    },
  },
  variables: {
    hostname: "https://densityco.github.io/clientele",
  },
})

# example.rb
require './thing'

# If you'd like to override variables at runtime, you can in the `configure` block:
Thing.configure do |r|
  r[:hostname] = "https://densityco.github.io"
end

# Use it.
puts Thing.users.get(id: 1)