class DTK::Client::Execute::Command

Attributes

input_hash[R]
result_var[R]

Public Class Methods

new(input_hash) click to toggle source
# File lib/execute/command.rb, line 24
def initialize(input_hash)
  @input_hash = input_hash
  @result_var = optional?(:result_var)
end

Private Instance Methods

optional?(key) click to toggle source
# File lib/execute/command.rb, line 36
def optional?(key)
  @input_hash[key]
end
required(key) click to toggle source
# File lib/execute/command.rb, line 30
def required(key)
  unless @input_hash.has_key?(key)
    raise ErrorUsage.new("Missing required key '#{key}' in: #{@input_hash.inspect}")
  end
  @input_hash[key]
end