Module: HammerCLIForeman::Template::TemplateCreateUpdateCommons
- Included in:
- CreateCommand, UpdateCommand
- Defined in:
- lib/hammer_cli_foreman/template.rb
Instance Method Summary collapse
Instance Method Details
#kinds ⇒ Object
22 23 24 25 |
# 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 ⇒ Object
9 10 11 |
# File 'lib/hammer_cli_foreman/template.rb', line 9 def option_snippet option_type && (option_type == "snippet") end |
#option_template_kind_id ⇒ Object
13 14 15 16 17 18 19 20 |
# 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 |