class DiffNews::DefaultHistory

Attributes

revisions[R]

Public Class Methods

new(provider, uuid, url) click to toggle source
# File lib/default_history.rb, line 12
def initialize provider, uuid, url
  @provider = provider
  @uuid = uuid
  @url = url

  @revisions = []
end

Public Instance Methods

append_changed_revision(title, teaser, text) click to toggle source
# File lib/default_history.rb, line 31
def append_changed_revision title, teaser, text
  new_revision = Revision.new @provider, @uuid, @revisions.count, title, teaser, text
  if revision_changed? @revisions.last, new_revision
    @revisions << new_revision
  end
end
clear() click to toggle source
# File lib/default_history.rb, line 38
def clear
  @revisions.clear
end
load() click to toggle source
# File lib/default_history.rb, line 20
def load
end
revision_changed?(rev1, rev2) click to toggle source
# File lib/default_history.rb, line 26
def revision_changed? rev1, rev2
  return true if rev1 == nil
  return rev1.title != rev2.title || rev1.teaser != rev2.teaser || rev1.text != rev2.text
end
store() click to toggle source
# File lib/default_history.rb, line 23
def store
end