module TCellAgent::Rust::Models

Public Class Methods

clean_nils(hash) click to toggle source
# File lib/tcell_agent/rust/models.rb, line 17
def self.clean_nils(hash)
  if hash.respond_to?(:compact!)
    hash.compact!
  else
    hash.delete_if { |_, v| v.nil? }
  end
  hash
end
convert_params(params_dict) click to toggle source
# File lib/tcell_agent/rust/models.rb, line 6
def self.convert_params(params_dict)
  return [] unless params_dict

  flattened_params = []
  params_dict.each do |param_name, param_value|
    flattened_params.push({ 'name' => param_name[-1], 'value' => param_value })
  end

  flattened_params
end