Class: Malartu::Snapshot

Inherits:
MalartuObject show all
Defined in:
lib/malartu/snapshot.rb

Overview

A snapshot is saved from a dashboard at a certain period in time

Instance Attribute Summary collapse

Attributes inherited from MalartuObject

#json

Class Method Summary collapse

Methods inherited from MalartuObject

#initialize, paginate?

Constructor Details

This class inherits a constructor from Malartu::MalartuObject

Instance Attribute Details

#snapshotsObject

Returns the value of attribute snapshots.



4
5
6
# File 'lib/malartu/snapshot.rb', line 4

def snapshots
  @snapshots
end

Class Method Details

.find(sid, dashboard_sid) ⇒ Object



5
6
7
8
# File 'lib/malartu/snapshot.rb', line 5

def self.find(sid, dashboard_sid)
  res = Malartu.request('get', "/kpi/dashboards/#{dashboard_sid}/snapshots/#{sid}")
  Malartu::Snapshot.new(res)
end

.list(dashboard_sid) ⇒ Object



10
11
12
13
14
15
# File 'lib/malartu/snapshot.rb', line 10

def self.list(dashboard_sid)
  res = Malartu.request('get', "/kpi/dashboards/#{dashboard_sid}")
  res['snapshots'].map do |snapshot|
    Malartu::Snapshot.new(snapshot)
  end
end