Class: Pgai::Resources::Remote::Snapshot

Inherits:
BaseRecord
  • Object
show all
Defined in:
lib/pgai/resources/remote/snapshot.rb

Class Method Summary collapse

Methods inherited from BaseRecord

client, #client, client=, #refresh_attributes, with_client

Methods included from Attributes

#assign_attribute, #assign_attributes, #has_attribute?, included, #initialize

Class Method Details

.allObject



16
17
18
# File 'lib/pgai/resources/remote/snapshot.rb', line 16

def all
  client.get(path).map { new(_1) }
end

.latestObject



20
21
22
# File 'lib/pgai/resources/remote/snapshot.rb', line 20

def latest
  all.max_by(&:created_at)
end

.pathObject



24
25
26
# File 'lib/pgai/resources/remote/snapshot.rb', line 24

def path
  "snapshots"
end