Class: Requirements Private

Inherits:
SimpleDelegator
  • Object
show all
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.



46
47
48
# File 'dependencies.rb', line 46

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.



50
51
52
53
54
55
56
57
58
59
60
# File 'dependencies.rb', line 50

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

      __getobj__.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:



63
64
65
# File 'dependencies.rb', line 63

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