From 650fe5c1fdbb00f78e7879ff95b6c98957ad32a7 Mon Sep 17 00:00:00 2001 From: Ben Balter Date: Tue, 11 Apr 2017 15:19:17 -0500 Subject: [PATCH] use reduce to format strings --- lib/jekyll-seo-tag/drop.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/jekyll-seo-tag/drop.rb b/lib/jekyll-seo-tag/drop.rb index 7cc5a6a..e997536 100644 --- a/lib/jekyll-seo-tag/drop.rb +++ b/lib/jekyll-seo-tag/drop.rb @@ -207,8 +207,8 @@ module Jekyll end def format_string(string) - FORMAT_STRING_METHODS.each do |method| - string = filters.public_send(method, string) + string = FORMAT_STRING_METHODS.reduce(string) do |memo, method| + filters.public_send(method, memo) end string unless string.empty?