Class: Cask::DSL::ConflictsWith Private
- Defined in:
- cask/dsl/conflicts_with.rb
Overview
This class is part of a private API. This class may only be used in the Homebrew/brew repository. Third parties should avoid using this class if possible, as it may be removed or changed without warning.
Class corresponding to the conflicts_with stanza.
Constant Summary collapse
- VALID_KEYS =
This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.
[:cask].freeze
Instance Method Summary collapse
- #initialize(**options) ⇒ void constructor private
- #merge!(other) ⇒ T.self_type private
- #to_h ⇒ Hash{Symbol => Array<String>} private
- #to_json(generator) ⇒ String private
Constructor Details
#initialize(**options) ⇒ void
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
17 18 19 20 21 22 23 24 |
# File 'cask/dsl/conflicts_with.rb', line 17 def initialize(**) ::Utils::Data.assert_valid_keys(, *VALID_KEYS) conflicts = .transform_values { |v| Set.new(Kernel.Array(v)) } conflicts.default = Set.new super(conflicts) end |
Instance Method Details
#merge!(other) ⇒ T.self_type
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
27 28 29 30 |
# File 'cask/dsl/conflicts_with.rb', line 27 def merge!(other) other.to_h.each { |key, values| __getobj__[key] |= Set.new(values) } self end |
#to_h ⇒ Hash{Symbol => Array<String>}
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
33 34 35 |
# File 'cask/dsl/conflicts_with.rb', line 33 def to_h __getobj__.transform_values(&:to_a) end |
#to_json(generator) ⇒ String
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
38 39 40 |
# File 'cask/dsl/conflicts_with.rb', line 38 def to_json(generator) to_h.to_json(generator) end |