Class: Taskchampion::Replica

Inherits:
Object
  • Object
show all
Defined in:
lib/taskchampion.rb

Overview

Override the Replica class to set the replica reference

Instance Method Summary collapse

Instance Method Details

#_original_working_setObject



33
# File 'lib/taskchampion.rb', line 33

alias_method :_original_working_set, :working_set

#commit_undo!(operations) ⇒ Object



50
51
52
# File 'lib/taskchampion.rb', line 50

def commit_undo!(operations)
  commit_reversed_operations(operations)
end

#task_operations(uuid) ⇒ Object

Ruby-style convenience methods for undo functionality



42
43
44
# File 'lib/taskchampion.rb', line 42

def task_operations(uuid)
  get_task_operations(uuid)
end

#undo!Object



54
55
56
57
58
# File 'lib/taskchampion.rb', line 54

def undo!
  ops = undo_operations
  return false if ops.empty?
  commit_undo!(ops)
end

#undo_operationsObject



46
47
48
# File 'lib/taskchampion.rb', line 46

def undo_operations
  get_undo_operations
end

#working_setObject



35
36
37
38
39
# File 'lib/taskchampion.rb', line 35

def working_set
  ws = _original_working_set
  ws.replica = self
  ws
end