Class: Dependencies

Inherits:
Array
  • Object
show all
Defined in:
Library/Homebrew/dependencies.rb

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Dependencies

Returns a new instance of Dependencies



4
5
6
# File 'Library/Homebrew/dependencies.rb', line 4

def initialize(*args)
  super(args)
end

Instance Method Details

#buildObject



18
19
20
# File 'Library/Homebrew/dependencies.rb', line 18

def build
  select(&:build?)
end

#defaultObject



26
27
28
# File 'Library/Homebrew/dependencies.rb', line 26

def default
  build + required + recommended
end

#inspectObject



30
31
32
# File 'Library/Homebrew/dependencies.rb', line 30

def inspect
  "#<#{self.class.name}: #{to_a}>"
end

#optionalObject



10
11
12
# File 'Library/Homebrew/dependencies.rb', line 10

def optional
  select(&:optional?)
end


14
15
16
# File 'Library/Homebrew/dependencies.rb', line 14

def recommended
  select(&:recommended?)
end

#requiredObject



22
23
24
# File 'Library/Homebrew/dependencies.rb', line 22

def required
  select(&:required?)
end