Class: Cask::Artifact::AbstractFlightBlock Private

Inherits:
AbstractArtifact show all
Defined in:
Library/Homebrew/cask/artifact/abstract_flight_block.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 block artifacts.

Direct Known Subclasses

PostflightBlock, PreflightBlock

Instance Attribute Summary collapse

Attributes inherited from AbstractArtifact

#cask

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractArtifact

#<=>, #config, dirmethod, english_article, english_name, read_script_arguments, #staged_path_join_executable, #to_s

Methods included from Predicable

#attr_predicate

Constructor Details

#initialize(cask, **directives) ⇒ AbstractFlightBlock

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 AbstractFlightBlock.


22
23
24
25
# File 'Library/Homebrew/cask/artifact/abstract_flight_block.rb', line 22

def initialize(cask, **directives)
  super(cask)
  @directives = directives
end

Instance Attribute Details

#directivesObject (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.


20
21
22
# File 'Library/Homebrew/cask/artifact/abstract_flight_block.rb', line 20

def directives
  @directives
end

Class Method Details

.dsl_keyObject

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.


12
13
14
# File 'Library/Homebrew/cask/artifact/abstract_flight_block.rb', line 12

def self.dsl_key
  super.to_s.sub(/_block$/, "").to_sym
end

.uninstall_dsl_keyObject

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.


16
17
18
# File 'Library/Homebrew/cask/artifact/abstract_flight_block.rb', line 16

def self.uninstall_dsl_key
  dsl_key.to_s.prepend("uninstall_").to_sym
end

Instance Method Details

#install_phaseObject

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.


27
28
29
# File 'Library/Homebrew/cask/artifact/abstract_flight_block.rb', line 27

def install_phase(**)
  abstract_phase(self.class.dsl_key)
end

#uninstall_phaseObject

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.


31
32
33
# File 'Library/Homebrew/cask/artifact/abstract_flight_block.rb', line 31

def uninstall_phase(**)
  abstract_phase(self.class.uninstall_dsl_key)
end