Class: Hbc::Artifact::AbstractFlightBlock

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

Direct Known Subclasses

PostflightBlock, PreflightBlock

Instance Attribute Summary collapse

Attributes inherited from AbstractArtifact

#cask, #config

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractArtifact

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

Methods included from Predicable

#attr_predicate

Constructor Details

#initialize(cask, **directives) ⇒ AbstractFlightBlock

Returns a new instance of AbstractFlightBlock



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

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

Instance Attribute Details

#directivesObject (readonly)

Returns the value of attribute directives



14
15
16
# File 'Library/Homebrew/cask/lib/hbc/artifact/abstract_flight_block.rb', line 14

def directives
  @directives
end

Class Method Details

.dsl_keyObject



6
7
8
# File 'Library/Homebrew/cask/lib/hbc/artifact/abstract_flight_block.rb', line 6

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

.uninstall_dsl_keyObject



10
11
12
# File 'Library/Homebrew/cask/lib/hbc/artifact/abstract_flight_block.rb', line 10

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

Instance Method Details

#install_phaseObject



21
22
23
# File 'Library/Homebrew/cask/lib/hbc/artifact/abstract_flight_block.rb', line 21

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

#uninstall_phaseObject



25
26
27
# File 'Library/Homebrew/cask/lib/hbc/artifact/abstract_flight_block.rb', line 25

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