class DIT3::Api::Wrappers::Tenants

Public Class Methods

new(client) click to toggle source
# File lib/dit3/api/wrappers/tenants.rb, line 3
def initialize client
    @client = client
end

Public Instance Methods

create(name) click to toggle source
# File lib/dit3/api/wrappers/tenants.rb, line 7
def create name
    @client.post("/tenants", {'name' => name})
end
exists?(name) click to toggle source
# File lib/dit3/api/wrappers/tenants.rb, line 19
def exists? name
    !get(name).nil?
end
get(name) click to toggle source
# File lib/dit3/api/wrappers/tenants.rb, line 11
def get name
    begin
        @client.get("/tenants/#{name}")
    rescue DIT3::Api::ApiError
        nil
    end
end