lib/jamf/api/connection.rb
# Apply defaults to the unset params for the #connect method
# First apply them from from the Jamf.config,
# then from the Jamf::Client (read from the jamf binary config),
# then from the Jamf module defaults
#
# @param params[Hash] The params for #connect
#
# @return [Hash] The params with defaults applied
#
Apply defaults to the unset params for the #connect method
First apply them from from the Jamf.config,
then from the Jamf::Client (read from the jamf binary config),
then from the Jamf module defaults
Apply defaults to the unset params for the #connect method First apply them from from the Jamf . config then from the Jamf :: Client ( read from the jamf binary config ) then from the Jamf module defaults
def apply_connection_defaults(params)
      params[:host] ||= params[:server]
      params[:port] ||= JAMFCLOUD_PORT if params[:host].to_s.end_with?(JAMFCLOUD_DOMAIN)
      apply_defaults_from_config(params)
      apply_module_defaults(params)
    end
def apply_connection_defaults ( params ) params [ :host ] ||= params [ :server ] params [ :port ] ||= JAMFCLOUD_PORT if params [ :host ] . to_s . end_with? ( JAMFCLOUD_DOMAIN ) apply_defaults_from_config ( params ) apply_module_defaults ( params ) end
Apply defaults to the unset params for the #connect method
First apply them from from the Jamf.config,
then from the Jamf::Client (read from the jamf binary config),
then from the Jamf module defaults
Apply defaults to the unset params for the #connect method First apply them from from the Jamf . config then from the Jamf :: Client ( read from the jamf binary config ) then from the Jamf module defaults
# must have a host, but accept legacy :server as well as :host # if we have no port set by this point, set to cloud port # if host is a cloud host. But leave port nil for other hosts # (will be set via client defaults or module defaults) # TODO: when clients are moved over to Jamf module # apply_defaults_from_client(params)
The params with defaults applied
The params with defaults applied
Hash
params
The params for #connect
The params for #connect