Class: Requirements Private

Inherits:
SimpleDelegator
  • Object
show all
Extended by:
T::Sig
Defined in:
dependencies.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.

A collection of requirements.

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Requirements

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.

Returns a new instance of Requirements.



51
52
53
# File 'dependencies.rb', line 51

def initialize(*args)
  super(Set.new(args))
end

Instance Method Details

#<<(other) ⇒ Object

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.



55
56
57
58
59
60
61
62
63
64
65
# File 'dependencies.rb', line 55

def <<(other)
  if other.is_a?(Comparable)
    grep(other.class) do |req|
      return self if req > other

      delete(req)
    end
  end
  super
  self
end

#inspectString

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.

Returns:



68
69
70
# File 'dependencies.rb', line 68

def inspect
  "#<#{self.class.name}: {#{to_a.join(", ")}}>"
end