Method: JSS::Updatable#update

Defined in:
lib/jss/api_object/updatable.rb

#updateBoolean

Save changes to the JSS

Returns:

  • (Boolean)

    success

Raises:



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/jss/api_object/updatable.rb', line 92

def update
  return nil unless @need_to_update
  raise JSS::UnsupportedError, "Editing #{self.class::RSRC_LIST_KEY} isn't yet supported. Please use other Casper workflows." unless updatable?
  raise JSS::NoSuchItemError, "Not In JSS! Use #create to create this #{self.class::RSRC_OBJECT_KEY} in the JSS before updating it." unless @in_jss

  @api.put_rsrc @rest_rsrc, rest_xml
  @need_to_update = false
  refresh_icon if self_servable?

  # clear any cached all-lists or id-maps for this class
  # so they'll re-cache as needed
  @api.flushcache self.class::RSRC_LIST_KEY

  @id
end