Class: Malartu::Schedule
Overview
A schedule is what tells Malartu when to aggregate the data
Instance Attribute Summary
#json
Class Method Summary
collapse
#initialize, paginate?
Class Method Details
.find(id = 'api') ⇒ Object
.list ⇒ Object
9
10
11
12
13
14
|
# File 'lib/malartu/schedule.rb', line 9
def self.list
res = Malartu.request('get', '/kpi/schedules')
res['schedules'].map do |schedule|
Malartu::Schedule.new(schedule)
end
end
|
.update(id = 'api', active: false) ⇒ Object
16
17
18
19
20
21
22
|
# File 'lib/malartu/schedule.rb', line 16
def self.update(id = 'api', active: false)
fail 'Invalid ID' unless id == 'api'
params = {}
params[:active] = active unless active.nil?
res = Malartu.request('patch', "/kpi/schedules/#{id}", params)
Malartu::Schedule.new(res)
end
|