Class: HammerCLIKatello::Output::Formatters::DependencyFormatter

Inherits:
HammerCLI::Output::Formatters::FieldFormatter
  • Object
show all
Defined in:
lib/hammer_cli_katello/output/formatters.rb

Instance Method Summary collapse

Instance Method Details

#format(dependency, _ = {}) ⇒ Object



15
16
17
18
19
20
21
22
23
# File 'lib/hammer_cli_katello/output/formatters.rb', line 15

def format(dependency, _ = {})
  name = dependency[:name] || dependency['name']
  version = dependency[:version_requirement] || dependency['version_requirement']
  if version
    "%s ( %s )" % [name, version]
  else
    name
  end
end