Class: ElFinder2::Command::Size

Inherits:
Base
  • Object
show all
Includes:
HashUtils
Defined in:
lib/el_finder2/command/size.rb

Overview

Returns the size of a directory or file.

Instance Method Summary collapse

Methods included from HashUtils

#from_base64url, #to_base64url, #to_path

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from ElFinder2::Command::Base

Instance Method Details

#executeObject

Response:

size: The total size for all the supplied targets.


9
10
11
12
13
# File 'lib/el_finder2/command/size.rb', line 9

def execute
  size = @targets.sum(&:size)

  render json: { size: size }
end