Class: DatabasusRuby::Database
- 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
Instance Method Summary collapse
- #backup ⇒ Object
-
#backups(**filters) ⇒ Collection
Takes the same filters as Backups#list.
Methods inherited from Record
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
#backup ⇒ Object
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.
13 14 15 |
# File 'lib/databasus_ruby/records/database.rb', line 13 def backups(**filters) client.backups.list(database_id: id!, **filters) end |