class HammerCLIForeman::UpdateCommand

Public Class Methods

command_name(name=nil) click to toggle source
Calls superclass method
# File lib/hammer_cli_foreman/commands.rb, line 534
def self.command_name(name=nil)
  super(name) || "update"
end
create_option_builder() click to toggle source
# File lib/hammer_cli_foreman/commands.rb, line 538
def self.create_option_builder
  builder = super
  builder.builders << SearchablesUpdateOptionBuilder.new(resource, searchables) if resource_defined?
  builder
end
inherited(child) click to toggle source
# File lib/hammer_cli_foreman/commands.rb, line 544
def self.inherited(child)
  child.success_message_for(:nothing_to_do, _('Nothing to update.'))
end

Public Instance Methods

clean_up_context() click to toggle source
Calls superclass method
# File lib/hammer_cli_foreman/commands.rb, line 548
def clean_up_context
  super
  context.delete(:action_message)
end
method_options_for_params(params, options) click to toggle source
Calls superclass method
# File lib/hammer_cli_foreman/commands.rb, line 557
def method_options_for_params(params, options)
  opts = super
  # overwrite searchables with correct values
  searchables.for(resource).each do |s|
    next unless params.map(&:name).include?(s.name)

    new_value = get_option_value("new_#{s.name}")
    opts[s.name] = new_value unless new_value.nil?
  end
  opts
end
success_message() click to toggle source
# File lib/hammer_cli_foreman/commands.rb, line 553
def success_message
  success_message_for(context[:action_message] || :default)
end