class Snapsync::SyncLastPolicy

A simple policy that synchronizes only the last snapshot (that is, snapsync's own synchronization point)

Public Class Methods

from_config(config) click to toggle source
# File lib/snapsync/sync_last_policy.rb, line 5
def self.from_config(config)
    new
end

Public Instance Methods

filter_snapshots(snapshots) click to toggle source

(see DefaultSyncPolicy#filter_snapshots)

# File lib/snapsync/sync_last_policy.rb, line 18
def filter_snapshots(snapshots)
    last = snapshots.sort_by(&:num).reverse.
        find { |s| !s.synchronization_point? }
    [last]
end
pretty_print(pp) click to toggle source
# File lib/snapsync/sync_last_policy.rb, line 13
def pretty_print(pp)
    pp.text "will keep only the latest snapshot"
end
to_config() click to toggle source
# File lib/snapsync/sync_last_policy.rb, line 9
def to_config
    Array.new
end