Class: Gaptool::SetCommand

Inherits:
Clamp::Command
  • Object
show all
Defined in:
lib/gaptool-client.rb

Instance Method Summary collapse

Instance Method Details

#convert_bool(v) ⇒ Object



246
247
248
249
250
251
252
253
254
255
# File 'lib/gaptool-client.rb', line 246

def convert_bool(v)
  case v.downcase
  when "true"
    true
  when "false"
    false
  else
    v
  end
end

#executeObject



257
258
259
260
261
262
263
# File 'lib/gaptool-client.rb', line 257

def execute
  if parameter_list.length != value_list.length
    puts Rainbow("parameter and value length mismatch").red
  end
  params = Hash[parameter_list.each_with_index.map {|p, i| [p, convert_bool(value_list[i])]}]
  infohelper([$api.setparameters(instance, params)], parseable?, grepable?)
end