Class: SuperSettings::Storage::S3Storage
- Inherits:
-
JSONStorage
- Object
- StorageAttributes
- JSONStorage
- SuperSettings::Storage::S3Storage
- Defined in:
- lib/super_settings/storage/s3_storage.rb
Overview
Storage backend for storing the settings in an S3 object. This should work with any S3-compatible storage service.
Defined Under Namespace
Classes: Configuration
Constant Summary collapse
- SETTINGS_FILE =
"settings.json"- HISTORY_FILE_SUFFIX =
".history.json"- DEFAULT_PATH =
"super_settings"
Instance Attribute Summary
Attributes inherited from StorageAttributes
#created_at, #description, #key, #raw_value, #updated_at, #value_type
Class Method Summary collapse
Methods inherited from JSONStorage
all, #as_json, create_history, #created_at=, find_by_key, #history, parse_settings, save_all, #updated_at=, updated_since
Methods included from Transaction
included, #persisted=, #persisted?, #save!
Methods inherited from StorageAttributes
#deleted=, #deleted?, #initialize, #persisted=, #persisted?
Methods included from SuperSettings::Storage
#==, #create_history, #created_at, #created_at=, #deleted=, #deleted?, #description, #description=, #history, included, #key, #key=, #persisted?, #raw_value, #raw_value=, #save!, #updated_at, #updated_at=, #value_type, #value_type=
Constructor Details
This class inherits a constructor from SuperSettings::Storage::StorageAttributes
Class Method Details
.configuration ⇒ Object
80 81 82 |
# File 'lib/super_settings/storage/s3_storage.rb', line 80 def configuration @config ||= Configuration.new end |
.destroy_all ⇒ Object
84 85 86 87 88 89 90 |
# File 'lib/super_settings/storage/s3_storage.rb', line 84 def destroy_all s3_bucket.objects(prefix: configuration.path).each do |object| if object.key == file_path(SETTINGS_FILE) || object.key.end_with?(HISTORY_FILE_SUFFIX) object.delete end end end |
.last_updated_at ⇒ Object
76 77 78 |
# File 'lib/super_settings/storage/s3_storage.rb', line 76 def last_updated_at all.collect(&:updated_at).compact.max end |