Class: DatabasusRuby::Database

Inherits:
Record show all
Defined in:
lib/databasus_ruby/records/database.rb,
sig/databasus_ruby.rbs

Overview

One database, as returned by the Databases endpoint.

database = client.databases.get(id)
database.backups(status: "COMPLETED")
database.backup                       # queue a run

Both delegate to the Backups endpoint, which owns the requests.

Instance Attribute Summary

Attributes inherited from Record

#client

Instance Method Summary collapse

Methods inherited from Record

#id!, #initialize

Methods inherited from Object

#==, #[], #hash, #initialize, #inspect, #key?, #keys, #method_missing, #respond_to_missing?, #to_h

Constructor Details

This class inherits a constructor from DatabasusRuby::Record

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class DatabasusRuby::Object

Instance Method Details

#backupObject

Returns:



17
18
19
# File 'lib/databasus_ruby/records/database.rb', line 17

def backup
  client.backups.create(database_id: id!)
end

#backups(**filters) ⇒ Collection

Takes the same filters as Backups#list.

Parameters:

Returns:



13
14
15
# File 'lib/databasus_ruby/records/database.rb', line 13

def backups(**filters)
  client.backups.list(database_id: id!, **filters)
end