class Object

An approximation of Maybe.orElse REFACTOR Replace with maddox's better_or_else gem.

Public Instance Methods

or_else() click to toggle source
# File lib/jekyll-released-posts.rb, line 6
def or_else
  self
end
released_posts() click to toggle source

REFACTOR Replace this with a method that computes on the fly

# File lib/jekyll-released-posts.rb, line 35
def released_posts
  # CONTRACT self.posts already only selects published posts (or so we believe)
  # REFACTOR Move this into a filter on any array of Document objects and not only site.posts
  posts.select { | document |
    JekyllReleasedPosts::ReleasedPost.new(document).released?(as_of: Time.now)
  }
end