Class: Cask::Artifact::AbstractFlightBlock

Inherits:
AbstractArtifact show all
Defined in:
brew/Library/Homebrew/cask/artifact/abstract_flight_block.rb

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

Returns a new instance of AbstractFlightBlock



18
19
20
21
# File 'brew/Library/Homebrew/cask/artifact/abstract_flight_block.rb', line 18

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

Instance Attribute Details

#directivesObject (readonly)

Returns the value of attribute directives



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

def directives
  @directives
end

Class Method Details

.dsl_keyObject



8
9
10
# File 'brew/Library/Homebrew/cask/artifact/abstract_flight_block.rb', line 8

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

.uninstall_dsl_keyObject



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

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

Instance Method Details

#install_phaseObject



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

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

#uninstall_phaseObject



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

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