Module: HammerCLIForeman::Template::TemplateCreateUpdateCommons

Included in:
CreateCommand, UpdateCommand
Defined in:
lib/hammer_cli_foreman/template.rb

Instance Method Summary collapse

Instance Method Details

#option_snippetObject



9
10
11
# File 'lib/hammer_cli_foreman/template.rb', line 9

def option_snippet
  option_type && (option_type == "snippet")
end

#option_template_kind_idObject



13
14
15
16
17
18
# File 'lib/hammer_cli_foreman/template.rb', line 13

def option_template_kind_id
  kinds = HammerCLIForeman.collection_to_common_format(
    HammerCLIForeman.foreman_resource!(:template_kinds).call(:index))
  table = kinds.inject({}){ |result, k| result.update(k["name"] => k["id"]) }
  table[option_type]
end