lib/jss/api_object/extendable.rb
def validate_ea_value(ea_name, value, validate_popup_choice, refresh)
      return JSS::BLANK if value.to_s == JSS::BLANK

      value =
        case ea_types[ea_name]
        when JSS::ExtensionAttribute::DATA_TYPE_DATE
          JSS.parse_datetime(value).to_s
        when *JSS::ExtensionAttribute::NUMERIC_TYPES
          validate_integer_ea_value ea_name, value
        else
          value.to_s
        end # case

      validate_popup_value(ea_name, value, refresh) if validate_popup_choice

      value
    end
# is the value being passed to set_ext_attr valid?
# Converts values as needed (e.g. strings to integers or Times)
#
# If the EA is defined to hold a string, any value is accepted and
# converted with #to_s
#
# Note: All EAs can be blank
#
# @param name[String] the name of the extension attribute to set
#
# @param value[String,Time,Integer] the new value for the extension
#   attribute for this user
#
# @param validate_popup_choice[Boolean] validate the new value against the E.A. definition.
#   Defaults to true.
#
# @param refresh[Boolean] Re-read the ext. attrib definition from the API,
#   for popup validation.
#
# @return [Object] the possibly modified valid value
#


If the EA is defined to hold a string, any value is accepted and
converted with #to_s

All EAs can be blank
If the EA is defined to hold a string any value is accepted and converted with #to_s All EAs can be blank
def validate_ea_value(ea_name, value, validate_popup_choice, refresh)
      return JSS::BLANK if value.to_s == JSS::BLANK
      value =
        case ea_types[ea_name]
        when JSS::ExtensionAttribute::DATA_TYPE_DATE
          JSS.parse_datetime(value).to_s
        when *JSS::ExtensionAttribute::NUMERIC_TYPES
          validate_integer_ea_value ea_name, value
        else
          value.to_s
        end 
      validate_popup_value(ea_name, value, refresh) if validate_popup_choice
      value
    end
def validate_ea_value ( ea_name , value , validate_popup_choice , refresh ) return JSS :: BLANK if value . to_s == JSS :: BLANK value = case ea_types [ ea_name ] when JSS :: ExtensionAttribute :: DATA_TYPE_DATE JSS . parse_datetime ( value ) . to_s when * JSS :: ExtensionAttribute :: NUMERIC_TYPES validate_integer_ea_value ea_name , value else value . to_s end validate_popup_value ( ea_name , value , refresh ) if validate_popup_choice value end
is the value being passed to set_ext_attr valid?
is the value being passed to set_ext_attr valid?
# case
the possibly modified valid value
the possibly modified valid value
Object
ea_name
value
the new value for the extension attribute for this user
the new value for the extension attribute for this user
validate_popup_choice
validate the new value against the E.A. definition. Defaults to true.
validate the new value against the E . A . definition . Defaults to true .
refresh
Re-read the ext. attrib definition from the API, for popup validation.
Re - read the ext . attrib definition from the API for popup validation .
name
the name of the extension attribute to set
the name of the extension attribute to set