Class: HammerCLIForeman::Interface

Inherits:
Command
  • Object
show all
Defined in:
lib/hammer_cli_foreman/interface.rb

Defined Under Namespace

Modules: InterfaceUpdate Classes: CreateCommand, DeleteCommand, InfoCommand, ListCommand, UpdateCommand

Class Method Summary collapse

Methods inherited from Command

alias_name_for_resource, build_options, connection_name, create_option_builder, #customized_options, #dependency_resolver, dependency_resolver, #exception_handler_class, #get_identifier, #get_resource_id, #get_resource_ids, #request_params, resolver, #resolver, resource_alias_name_mapping, resource_config, resource_name_mapping, #searchables, searchables, #send_request, #transform_format

Class Method Details

.format_type(nic) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/hammer_cli_foreman/interface.rb', line 8

def self.format_type(nic)
  flags = []
  flags << _('primary') if nic['primary']
  flags << _('provision') if nic['provision']

  type = nic['type']
  if !flags.empty?
    type += " (#{flags.join(', ')})"
  end
  type
end