Class: Cask::DSL::ConflictsWith Private

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
Library/Homebrew/cask/dsl/conflicts_with.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.

Class corresponding to the conflicts_with stanza.

Constant Summary collapse

VALID_KEYS =

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.

[
  :formula,
  :cask,
  :macos,
  :arch,
  :x11,
  :java,
].freeze

Instance Method Summary collapse

Constructor Details

#initialize(**options) ⇒ ConflictsWith

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


24
25
26
27
28
29
30
31
# File 'Library/Homebrew/cask/dsl/conflicts_with.rb', line 24

def initialize(**options)
  options.assert_valid_keys!(*VALID_KEYS)

  conflicts = options.transform_values { |v| Set.new(Array(v)) }
  conflicts.default = Set.new

  super(conflicts)
end

Instance Method Details

#to_json(generator) ⇒ 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.


33
34
35
# File 'Library/Homebrew/cask/dsl/conflicts_with.rb', line 33

def to_json(generator)
  transform_values(&:to_a).to_json(generator)
end