Class: Upcloudify
- Inherits:
-
Object
- Object
- Upcloudify
- Defined in:
- lib/upcloudify.rb,
lib/notifiers/slack.rb,
lib/upcloudify/version.rb
Defined Under Namespace
Modules: Notifiers Classes: S3
Constant Summary collapse
- VERSION =
"0.3"
Instance Method Summary collapse
-
#initialize(uploader:, notifier:) ⇒ Upcloudify
constructor
A new instance of Upcloudify.
- #upload_and_notify(filename:, attachment:, message: "%s") ⇒ Object
Constructor Details
#initialize(uploader:, notifier:) ⇒ Upcloudify
Returns a new instance of Upcloudify.
13 14 15 16 |
# File 'lib/upcloudify.rb', line 13 def initialize(uploader:, notifier:) @uploader = uploader @notifier = notifier end |
Instance Method Details
#upload_and_notify(filename:, attachment:, message: "%s") ⇒ Object
18 19 20 21 22 |
# File 'lib/upcloudify.rb', line 18 def upload_and_notify(filename:, attachment:, message: "%s") expiration = (Date.today + 7).to_time file = @uploader.upload(filename, ) @notifier.notify(text: % file.url(expiration)) end |