Class: GemCollection

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/gem_checks/gem_collection.rb

Defined Under Namespace

Classes: EmptyGemCollection

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(collection) ⇒ GemCollection

Returns a new instance of GemCollection.



3
4
5
6
# File 'lib/gem_checks/gem_collection.rb', line 3

def initialize(collection)
  @collection = collection
  super(collection)
end

Class Method Details

.wrap(collection) ⇒ Object



15
16
17
# File 'lib/gem_checks/gem_collection.rb', line 15

def self.wrap(collection)
  collection.empty? ? EmptyGemCollection.new : new(collection)
end

Instance Method Details

#display_vulnerableObject



8
9
10
11
12
13
# File 'lib/gem_checks/gem_collection.rb', line 8

def display_vulnerable
  collection.each do |gem|
    puts format_gem_message(gem)
  end
  self
end