lib/pragmater/commenter.rb in pragmater-0.1.0 vs lib/pragmater/commenter.rb in pragmater-1.0.0
- old
+ new
@@ -19,10 +19,14 @@
private
attr_reader :older, :newer, :formatter
+ def filter comments
+ Array(comments).select { |comment| comment =~ formatter.valid_formats }
+ end
+
def format comments
- Array(comments).map { |comment| formatter.new(comment).format }
+ filter(comments).map { |comment| formatter.new(comment).format }
end
end
end