Class: Riserva::Commands::UploadFile

Inherits:
ApplicationCommand show all
Defined in:
lib/riserva/commands/upload_file.rb

Instance Method Summary collapse

Methods inherited from ApplicationCommand

#files

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