Class: Riserva::Commands::UploadFile
- Inherits:
-
ApplicationCommand
- Object
- ApplicationCommand
- Riserva::Commands::UploadFile
- Defined in:
- lib/riserva/commands/upload_file.rb
Instance Method Summary collapse
- #call(path) ⇒ Object
-
#initialize(storage) ⇒ UploadFile
constructor
A new instance of UploadFile.
Methods inherited from ApplicationCommand
Constructor Details
#initialize(storage) ⇒ UploadFile
Returns a new instance of UploadFile.
3 4 5 6 |
# File 'lib/riserva/commands/upload_file.rb', line 3 def initialize(storage) super() @storage = storage end |
Instance Method Details
#call(path) ⇒ Object
8 9 10 11 12 |
# File 'lib/riserva/commands/upload_file.rb', line 8 def call(path) return broadcast(:invalid) unless super success? ? broadcast(:ok, @path) : broadcast(:failed, @path) end |