Class: Pgai::Resources::Remote::BaseRecord

Inherits:
Object
  • Object
show all
Includes:
Attributes
Defined in:
lib/pgai/resources/remote/base_record.rb

Direct Known Subclasses

Clone, CloneMetadata, CloneStatus, DbObject, Snapshot

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Attributes

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

Class Method Details

.clientObject



10
11
12
# File 'lib/pgai/resources/remote/base_record.rb', line 10

def client
  @@client ||= nil
end

.client=(value) ⇒ Object



14
15
16
# File 'lib/pgai/resources/remote/base_record.rb', line 14

def client=(value)
  @@client = value
end

.with_client(new_client) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/pgai/resources/remote/base_record.rb', line 18

def with_client(new_client)
  previous = client
  self.client = new_client
  yield
ensure
  self.client = previous
end

Instance Method Details

#clientObject



27
28
29
# File 'lib/pgai/resources/remote/base_record.rb', line 27

def client
  self.class.client
end

#refresh_attributes(data) ⇒ Object



31
32
33
# File 'lib/pgai/resources/remote/base_record.rb', line 31

def refresh_attributes(data)
  assign_attributes(data)
end