Class: BrickFTP::RESTfulAPI::GetBehavior

Inherits:
Object
  • Object
show all
Includes:
Command
Defined in:
lib/brick_ftp/restful_api/get_behavior.rb

Overview

Show a behavior

See Also:

Instance Method Summary collapse

Methods included from Command

included, #initialize

Instance Method Details

#call(id) ⇒ BrickFTP::Types::Behavior?

Returns a single behavior.

Parameters:

  • id (Integer)

    Globally unique identifier of each behavior.

Returns:



18
19
20
21
22
23
# File 'lib/brick_ftp/restful_api/get_behavior.rb', line 18

def call(id)
  res = client.get("/api/rest/v1/behaviors/#{id}.json")
  return nil if !res || res.empty?

  BrickFTP::Types::Behavior.new(**res.symbolize_keys)
end