module HammerCLIForeman::SmartVariableUpdateCreateCommons

Public Class Methods

included(base) click to toggle source
# File lib/hammer_cli_foreman/smart_variable.rb, line 5
def self.included(base)
  base.option "--variable-type", "VARIABLE_TYPE", _("Type of the variable."),
              :format => HammerCLI::Options::Normalizers::Enum.new(
                  ['string', 'boolean', 'integer', 'real', 'array', 'hash', 'yaml', 'json'])
  base.option "--validator-type", "VALIDATOR_TYPE", _("Type of the validator."),
              :format => HammerCLI::Options::Normalizers::Enum.new(['regexp', 'list', ''])
  base.option "--override-value-order", "OVERRIDE_VALUE_ORDER", _("The order in which values are resolved"),
              :format => HammerCLI::Options::Normalizers::List.new

  base.build_options :without => [:variable_type, :validator_type, :override_value_order]
end

Public Instance Methods

request_params() click to toggle source
Calls superclass method
# File lib/hammer_cli_foreman/smart_variable.rb, line 17
def request_params
  params = super
  override_order = params['smart_variable']['override_value_order']
  params['smart_variable']['override_value_order'] = override_order.join("\n") if override_order.is_a?(Array)
  params
end