Class: Requirements Private

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

A collection of requirements.

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Requirements

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


46
47
48
# File 'Library/Homebrew/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. You should avoid using this method if possible, as it may be removed or be changed in the future.


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

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

      delete(req)
    end
  end
  super
  self
end

#inspectObject

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.


62
63
64
# File 'Library/Homebrew/dependencies.rb', line 62

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