A bit of golf

This commit is contained in:
Alexey Verkhovsky 2005-01-21 23:00:29 +00:00
parent 578becb609
commit 87ab5d00ae

View file

@ -6,6 +6,7 @@ require 'author'
require 'page'
class Revision
attr_accessor :page, :number, :content, :created_at, :author
def initialize(page, number, content, created_at, author)
@ -29,7 +30,7 @@ class Revision
end
def previous_revision
number - 1 >= 0 && page.revisions[number - 1]
number > 0 ? page.revisions[number - 1] : nil
end
# Returns an array of all the WikiWords present in the content of this revision.
@ -78,4 +79,5 @@ class Revision
def display_content_for_export
WikiContent.new(self, {:mode => :export} )
end
end