Class: UU::OS::CMD::CommandController

Inherits:
Application::AbstractController show all
Defined in:
uu_os_cmd-server-2.5.1/lib/uu/os/cmd/command_controller.rb

Overview

Ancestor for development of custom command controllers. All controllers must define PATH constant (for controller mapping) and should define at least on_exec method. Additionally, it is possible to modify default processing behavior by overriding methods declared in AbstractController.

Direct Known Subclasses

AsyncCommandController

Instance Method Summary (collapse)

Methods included from Util::ResponseBuilder

#handle_response, #response, #streamed_response

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class UU::OS::Application::AbstractController

Instance Method Details

- (Object) on_exec(ctx)

Main action method of controller.

Parameters:

Returns:

  • (Object)

    Result of command (any object to be serialized via to_json method, or response provided by response, file_download_response or streamed_response methods).

Raises:



39
40
41
42
# File 'uu_os_cmd-server-2.5.1/lib/uu/os/cmd/command_controller.rb', line 39

def on_exec(ctx)
  raise UU::OS::CMD::CommandError.new(UU::OS::IPC::ErrorKind::SERVER, UU::OS::IPC::ErrorCodes::NOT_IMPLEMENTED,
  	"Method on_exec is not implemented on #{self.class.name}.")
end