Module: Feedbook::Comparers::PostsComparer

Defined in:
lib/feedbook/comparers/posts_comparer.rb

Class Method Summary collapse

Class Method Details

.get_new_posts(old_posts, new_posts) ⇒ type

Returns only posts from new posts list that does not exists in old posts list.

Parameters:

  • old_posts (Array)

    list of old posts

  • new_posts (Array)

    list of new posts

Returns:

  • (type)
    description


10
11
12
# File 'lib/feedbook/comparers/posts_comparer.rb', line 10

def self.get_new_posts(old_posts, new_posts)
  new_posts.select { |post| old_posts.all? { |opost| opost.url != post.url } }
end