Class: Cask::Artifact::AbstractUninstall Private
- Inherits:
-
AbstractArtifact
- Object
- AbstractArtifact
- Cask::Artifact::AbstractUninstall
- Defined in:
- Library/Homebrew/cask/artifact/abstract_uninstall.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Abstract superclass for uninstall artifacts.
Constant Summary collapse
- ORDERED_DIRECTIVES =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
[ :early_script, :launchctl, :quit, :signal, :login_item, :kext, :script, :pkgutil, :delete, :trash, :rmdir, ].freeze
Instance Attribute Summary collapse
- #directives ⇒ Object readonly private
Attributes inherited from AbstractArtifact
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(cask, directives) ⇒ AbstractUninstall
constructor
private
A new instance of AbstractUninstall.
- #summarize ⇒ Object private
- #to_h ⇒ Object private
Methods inherited from AbstractArtifact
#<=>, #config, dirmethod, dsl_key, english_article, english_name, read_script_arguments, #staged_path_join_executable, #to_s
Methods included from Predicable
Constructor Details
#initialize(cask, directives) ⇒ AbstractUninstall
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of AbstractUninstall.
38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'Library/Homebrew/cask/artifact/abstract_uninstall.rb', line 38 def initialize(cask, directives) directives.assert_valid_keys!(*ORDERED_DIRECTIVES) super(cask) directives[:signal] = Array(directives[:signal]).flatten.each_slice(2).to_a @directives = directives return unless directives.key?(:kext) cask.caveats do kext end end |
Instance Attribute Details
#directives ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
36 37 38 |
# File 'Library/Homebrew/cask/artifact/abstract_uninstall.rb', line 36 def directives @directives end |
Class Method Details
.from_args(cask, **directives) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
32 33 34 |
# File 'Library/Homebrew/cask/artifact/abstract_uninstall.rb', line 32 def self.from_args(cask, **directives) new(cask, directives) end |
Instance Method Details
#summarize ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
56 57 58 |
# File 'Library/Homebrew/cask/artifact/abstract_uninstall.rb', line 56 def summarize to_h.flat_map { |key, val| Array(val).map { |v| "#{key.inspect} => #{v.inspect}" } }.join(", ") end |
#to_h ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
52 53 54 |
# File 'Library/Homebrew/cask/artifact/abstract_uninstall.rb', line 52 def to_h directives.to_h end |