module HammerCLIForeman::Template::TemplateCreateUpdateCommons

Public Instance Methods

kinds() click to toggle source
# File lib/hammer_cli_foreman/template.rb, line 22
def kinds
  HammerCLIForeman.collection_to_common_format(
    HammerCLIForeman.foreman_resource!(:template_kinds).call(:index))
end
option_snippet() click to toggle source
# File lib/hammer_cli_foreman/template.rb, line 9
def option_snippet
  option_type && (option_type == "snippet")
end
option_template_kind_id() click to toggle source
# File lib/hammer_cli_foreman/template.rb, line 13
def option_template_kind_id
  table = kinds.inject({}){ |result, k| result.update(k["name"] => k["id"]) }
  if option_snippet == false && table[option_type].nil?
    signal_usage_error _("unknown template kind")
  else
    table[option_type]
  end
end