lib/jss/api_object.rb
# Delete this item from the JSS.
#
# @seealso {APIObject.delete} for deleting
# one or more objects by id without needing to instantiate
#
# Subclasses may want to redefine this method,
# first calling super, then setting other attributes to
# nil, false, empty, etc..
#
# @return [void]
#
Delete this item from the JSS.
Delete this item from the JSS .
def delete
      return unless @in_jss
      @api.delete_rsrc @rest_rsrc
      @rest_rsrc = "#{self.class::RSRC_BASE}/name/#{CGI.escape @name.to_s}"
      @id = nil
      @in_jss = false
      @need_to_update = false
      @api.flushcache self.class::RSRC_LIST_KEY
      :deleted
    end
def delete return unless @in_jss @api . delete_rsrc @rest_rsrc @rest_rsrc = "#{self.class::RSRC_BASE}/name/#{CGI.escape @name.to_s}" @id = nil @in_jss = false @need_to_update = false @api . flushcache self . class :: RSRC_LIST_KEY :deleted end
Delete this item from the JSS.
Delete this item from the JSS .
# clear any cached all-lists or id-maps for this class # so they'll re-cache as needed # self.class.all :refresh, api: @api
None
void
seealso
{APIObject.delete} for deleting one or more objects by id without needing to instantiate Subclasses may want to redefine this method, first calling super, then setting other attributes to nil, false, empty, etc
{ APIObject . delete } for deleting one or more objects by id without needing to instantiate Subclasses may want to redefine this method first calling super then setting other attributes to nil false empty etc