Module: Rssly::Collection::AgeFilter

Defined in:
lib/rssly/collection/age_filter.rb

Overview

Filters articles out by age

Class Method Summary collapse

Class Method Details

.parse(articles, min: nil, max: nil) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/rssly/collection/age_filter.rb', line 5

def self.parse(articles, min: nil, max: nil)
  articles.select do |article|
    if min && article.published < min then false
    elsif max && article.published > max then false
    else true
    end
  end
end