Class: Timekit::App::Client

Inherits:
Client
  • Object
show all
Defined in:
lib/timekit/app/client.rb

Overview

Client class for the app resource

Constant Summary collapse

API_PATH =
'/apps'

Instance Method Summary collapse

Methods inherited from Client

#initialize

Constructor Details

This class inherits a constructor from Timekit::Client

Instance Method Details

#create(name, settings = {}) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/timekit/app/client.rb', line 12

def create(name, settings = {})
  params = {
    name: name
  }

  params[:settings] = settings if settings

  post(API_PATH, params)
end

#delete(slug) ⇒ Object



28
29
30
# File 'lib/timekit/app/client.rb', line 28

def delete(slug)
  super(API_PATH + '/' + slug)
end

#listObject



8
9
10
# File 'lib/timekit/app/client.rb', line 8

def list
  get(API_PATH)
end

#update(slug, settings) ⇒ Object



22
23
24
25
26
# File 'lib/timekit/app/client.rb', line 22

def update(slug, settings)
  params = settings

  put(API_PATH + '/' + slug, params)
end