Sha256: 9935667c2130a27bc2fe287db9dabe2c7866763ef1077d3fc70ea09273dddacc

Contents?: true

Size: 307 Bytes

Versions: 4

Compression:

Stored size: 307 Bytes

Contents


module BlogPostsHandler
  def get_new_blog_posts(posts, last_blog_post_tweeted)
    return [] unless posts && posts.length > 0
    return posts unless last_blog_post_tweeted
    new_posts = posts.reject { |post| Time.parse(post.updated.content.to_s) <= Time.parse(last_blog_post_tweeted.to_s) }
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
twog-0.3.0 lib/twog/blog_posts_handler.rb
twog-0.2.2 lib/twog/blog_posts_handler.rb
twog-0.2.1 lib/twog/blog_posts_handler.rb
twog-0.2.0 lib/twog/blog_posts_handler.rb