Parent

Class/Module Index [+]

Quicksearch

HammerCLIForeman::Defaults

Public Class Methods

new() click to toggle source
# File lib/hammer_cli_foreman/defaults.rb, line 4
def initialize
  @provider_name = 'foreman'
  @supported_defaults = [:organization_id, :location_id]
  @description = _('Use the default organization and/or location from the server')
end

Public Instance Methods

get_defaults(param) click to toggle source
# File lib/hammer_cli_foreman/defaults.rb, line 10
def get_defaults(param)
  param = "default_organization" if param == :organization_id
  param = "default_location" if param == :location_id
  user = get_user
  val = nil
  if user
    val = user["results"].first[param] if user["results"]
    val = val["id"] if val.is_a?(Hash) && param.include?("default")
  end
  val
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.