crystal_brium
crystal_brium
Access Brium's API using Crystal.
Projectfile
deps do
github "manastech/crystal_brium"
end
Usage
require "brium"
client_id = "..."
client_secret = "..."
oauth_client = Brium.new_oauth_client(client_id, client_secret)
access_token = # some OAuth2::AccessToken
session = OAuth2::Session.new(oauth_client, access_token) do
puts "Refreshing access token..."
end
api = Brium::API.new session
# Get workers
workers = api.workers active: true, admin: false, suspended: false
# Get clients
clients = api.clients
# Get entries
entries = api.entries billable_status: "billable,billed"
# Or sum some entries hours
total_hours = api.entries_sum billable_status: "billable,billed"
# Get holidays
holidays = api.holidays kind: "vacations", since_date: 3.days.ago
Repository
crystal_brium
Owner
Statistic
- 1
- 1
- 1
- 0
- 1
- over 1 year ago
- December 3, 2014
License
Links
Synced at
Sun, 22 Dec 2024 05:56:09 GMT
Languages