Class: Unwrappr::Writers::Composite
- Inherits:
-
Object
- Object
- Unwrappr::Writers::Composite
- Defined in:
- lib/unwrappr/writers/composite.rb
Overview
Delegate to many writers and combine their produced annotations into one.
Implements the ‘annotation_writer` interface required by the LockFileAnnotator.
Instance Method Summary collapse
-
#initialize(*writers) ⇒ Composite
constructor
A new instance of Composite.
- #write(gem_change, gem_change_info) ⇒ Object
Constructor Details
#initialize(*writers) ⇒ Composite
Returns a new instance of Composite.
10 11 12 |
# File 'lib/unwrappr/writers/composite.rb', line 10 def initialize(*writers) @writers = writers end |
Instance Method Details
#write(gem_change, gem_change_info) ⇒ Object
14 15 16 17 18 |
# File 'lib/unwrappr/writers/composite.rb', line 14 def write(gem_change, gem_change_info) @writers.map do |writer| writer.write(gem_change, gem_change_info) end.compact.join("\n") end |