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



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

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

  params[:settings] = settings if settings

  post(API_PATH, params)
end

#delete(slug) ⇒ Object



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

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

#listObject



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

def list
  get(API_PATH)
end

#update(slug, settings) ⇒ Object



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

def update(slug, settings)
  params = settings

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