Class: Gitt::Sanitizers::Trailers
- Inherits:
-
Object
- Object
- Gitt::Sanitizers::Trailers
- Defined in:
- lib/gitt/sanitizers/trailers.rb
Overview
Sanitizes content by turning it into an array of trailer records.
Instance Method Summary collapse
- #call(text) ⇒ Object
-
#initialize(parser: Parsers::Trailer.new) ⇒ Trailers
constructor
A new instance of Trailers.
Constructor Details
Instance Method Details
#call(text) ⇒ Object
11 12 13 14 15 |
# File 'lib/gitt/sanitizers/trailers.rb', line 11 def call text String(text).split("\n") .map { |line| parser.call line } .reject(&:empty?) end |