Class: Windoo::KillAppManager

Inherits:
BaseClasses::ArrayManager show all
Defined in:
lib/windoo/objects/kill_app_manager.rb

Overview

An ArrayManager for dealing with the KillApps of a Patch

An instance of this is returned by Patch#killApps

Constant Summary collapse

MEMBER_CLASS =

Constants

Windoo::KillApp

Constants inherited from BaseClasses::ArrayManager

BaseClasses::ArrayManager::PP_OMITTED_INST_VARS

Instance Attribute Summary

Attributes inherited from BaseClasses::ArrayManager

#container

Instance Method Summary collapse

Methods inherited from BaseClasses::ArrayManager

#[], #each, #empty?, #find, #find_by_attr, #first, #index, #initialize, #last, #pretty_print_instance_variables, #size, #to_a

Constructor Details

This class inherits a constructor from Windoo::BaseClasses::ArrayManager

Instance Method Details

#add_killApp(appName:, bundleId:) ⇒ Integer

Add a killApp to this patch

A killApp idetifies apps that cannot be running while this patch is installed. If the user is voluntarily applying the patch, they will be asked to quit the killApp. If the patch is being applied automatically, it will be killed automatically.

Parameters:

  • appName (String)

    The name of the application that cannot be running to install this patch. e.g. Safari.app

  • bundleId (String)

    The bundle id of the application that cannot be running to install this patch, e.g. com.apple.Safari

Returns:

  • (Integer)

    The id of the new killApp



41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/windoo/objects/kill_app_manager.rb', line 41

def add_killApp(appName:, bundleId:)
  new_ka = Windoo::KillApp.create(
    cnx: container.cnx,
    container: container,
    appName: appName,
    bundleId: bundleId
  )

  # call the method from our superclass to add it to the array
  add_member new_ka
  new_ka.primary_id
end

#delete_all_killAppsvoid

This method returns an undefined value.

Delete all the killApps



83
84
85
# File 'lib/windoo/objects/kill_app_manager.rb', line 83

def delete_all_killApps
  delete_all_members
end

#delete_killApp(id) ⇒ Integer

Delete a killApp

Parameters:

  • id (Integer)

    The killAppId of the desired killApp in the array

Returns:

  • (Integer)

    The id of the deleted killApp



75
76
77
# File 'lib/windoo/objects/kill_app_manager.rb', line 75

def delete_killApp(id)
  delete_member(id).deleted_id
end

#update_killApp(id, **attribs) ⇒ Integer

Update the details of an existing killApp

Values not set in the params are left unchanged

Parameters:

  • id (Integer)

    The killAppId of the desired killApp in the array

  • attribs (Hash)

    The attribute(s) to update. See #add_killApp

Returns:

  • (Integer)

    The id of the updated killApp



64
65
66
67
# File 'lib/windoo/objects/kill_app_manager.rb', line 64

def update_killApp(id, **attribs)
  ka = update_member(id, **attribs)
  ka.killAppId
end