Class: RailsArchiver::Transport::Base
- Inherits:
-
Object
- Object
- RailsArchiver::Transport::Base
- Defined in:
- lib/rails-archiver/transport/base.rb
Instance Method Summary collapse
- #configure(options) ⇒ Object
-
#initialize(model = nil, logger = nil) ⇒ Base
constructor
A new instance of Base.
-
#retrieve_archive(location = nil) ⇒ Hash
To be implemented by subclasses.
-
#store_archive(hash) ⇒ Object
To be implemented by subclasses.
Constructor Details
#initialize(model = nil, logger = nil) ⇒ Base
Returns a new instance of Base.
9 10 11 12 13 |
# File 'lib/rails-archiver/transport/base.rb', line 9 def initialize(model=nil, logger=nil) @model = model @options = {} @logger = logger || ::Logger.new(STDOUT) end |
Instance Method Details
#configure(options) ⇒ Object
16 17 18 |
# File 'lib/rails-archiver/transport/base.rb', line 16 def configure() @options = end |
#retrieve_archive(location = nil) ⇒ Hash
To be implemented by subclasses. Retrieve the archive that was previously created. S3 key). Otherwise will be figured out from the existing model in the database.
35 36 37 |
# File 'lib/rails-archiver/transport/base.rb', line 35 def retrieve_archive(location=nil) raise NotImplementedError end |
#store_archive(hash) ⇒ Object
To be implemented by subclasses. Store the archive somewhere to be retrieved later. You should also be storing the location somewhere such as on the model. Use @model to reference it. .to_json on it.
25 26 27 |
# File 'lib/rails-archiver/transport/base.rb', line 25 def store_archive(hash) raise NotImplementedError end |