class DTK::Client::Execute::Command::APICall

Public Class Methods

PreviousResponse(response_key) click to toggle source
# File lib/execute/command/api_call.rb, line 26
def self.PreviousResponse(response_key)
  PreviousResponse.new(response_key)
end
Required(key) click to toggle source

order matters; having these defs before requires; plus order of these requires

# File lib/execute/command/api_call.rb, line 23
def self.Required(key)
  Required.new(key)
end

Private Class Methods

array_form(obj) click to toggle source
# File lib/execute/command/api_call.rb, line 54
def self.array_form(obj)
  obj.kind_of?(Array) ? obj : [obj]
end
raw_executable_commands(method,&block) click to toggle source
# File lib/execute/command/api_call.rb, line 46
def self.raw_executable_commands(method,&block)
  if command_map = self::CommandMap[method]
    array_form(command_map).each{|raw_command|block.call(raw_command)}
  else
    raise ErrorUsage.new("The method on '#{method}' on object type '#{object_type()}' is not supported")
  end
end

Public Instance Methods

raw_executable_commands(&block) click to toggle source

calss block where on one or more commands that achieve the api

# File lib/execute/command/api_call.rb, line 35
def raw_executable_commands(&block)
  method = required(:method).to_sym
  case required(:object_type).to_sym
   when :service
     Service.raw_executable_commands(method,&block)
   else
    raise ErrorUsage.new("The object_type '#{object_type}' is not supported")
  end
end