class LinkedPosts

Public Class Methods

new(posts) click to toggle source
# File lib/linked_posts.rb, line 2
def initialize(posts)
  @posts = posts
end

Public Instance Methods

current() click to toggle source
# File lib/linked_posts.rb, line 10
def current
  @posts.detect { |p| p.slug == @slug }
end
next_post() click to toggle source
previous_post() click to toggle source
slug=(slug) click to toggle source
# File lib/linked_posts.rb, line 6
def slug=(slug)
  @slug = slug
end

Private Instance Methods

current_index() click to toggle source
# File lib/linked_posts.rb, line 24
def current_index
  @posts.index(current)
end