Method: Jamf::Extendable#validate_ea_value
- Defined in:
- lib/jamf/api/classic/api_objects/extendable.rb
#validate_ea_value(ea_name, value, validate_popup_choice, refresh) ⇒ Object
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
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 |
# File 'lib/jamf/api/classic/api_objects/extendable.rb', line 244 def validate_ea_value(ea_name, value, validate_popup_choice, refresh) return Jamf::BLANK if value.to_s == Jamf::BLANK value = case ea_types[ea_name] when Jamf::ExtensionAttribute::DATA_TYPE_DATE Jamf.parse_time(value).to_s when *Jamf::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 |