class DTK::Client::Commands::Common::Base
Public Class Methods
new(command_base,context_params)
click to toggle source
# File lib/commands/common/thor/common_base.rb, line 22 def initialize(command_base,context_params) @command_base = command_base @context_params = context_params end
Private Instance Methods
post(url_path,body=nil)
click to toggle source
# File lib/commands/common/thor/common_base.rb, line 43 def post(url_path,body=nil) @command_base.post(@command_base.rest_url(url_path),body) end
retrieve_arguments(mapping)
click to toggle source
# File lib/commands/common/thor/common_base.rb, line 27 def retrieve_arguments(mapping) @context_params.retrieve_arguments(mapping,@command_base.method_argument_names()) end
retrieve_option_hash(option_list)
click to toggle source
# File lib/commands/common/thor/common_base.rb, line 31 def retrieve_option_hash(option_list) ret = Hash.new option_values = @context_params.retrieve_thor_options(option_list,@command_base.options) option_values.each_with_index do |val,i| unless val.nil? key = option_list[i].to_s.gsub(/\!$/,'').to_sym ret.merge!(key => val) end end ret end