Class: BrickFTP::RESTfulAPI::ListFolderBehaviors
- Inherits:
-
Object
- Object
- BrickFTP::RESTfulAPI::ListFolderBehaviors
- Includes:
- Command
- Defined in:
- lib/brick_ftp/restful_api/list_folder_behaviors.rb
Overview
List behaviors for a folder
Params
PARAMETER | TYPE | DESCRIPTION |
---|---|---|
recursive | integer | Optionally set to 1 to have response include behaviors inherited from parent folders. |
Instance Method Summary collapse
-
#call(path, recursive: false) ⇒ Array<BrickFTP::Types::Behavior>
Returns the behaviors that apply to the given path.
Methods included from Command
Instance Method Details
#call(path, recursive: false) ⇒ Array<BrickFTP::Types::Behavior>
Returns the behaviors that apply to the given path.
By default, only behaviors applied directly on the the given path will be returned. If you would also like behaviors that are inherited from parent folders to be returned, the recursive query parameter can be passed in on the URL with the value of 1.
31 32 33 34 35 36 37 |
# File 'lib/brick_ftp/restful_api/list_folder_behaviors.rb', line 31 def call(path, recursive: false) endpoint = "/api/rest/v1/behaviors/folders/#{ERB::Util.url_encode(path)}" endpoint = "#{endpoint}?recursive=1" if recursive res = client.get(endpoint) res.map { |i| BrickFTP::Types::Behavior.new(**i.symbolize_keys) } end |