Class: OrgMode::Processors::ArchiveDoneOrgFile

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/org_mode/processors/archive_done.rb

Instance Method Summary collapse

Constructor Details

#initialize(org_file) ⇒ ArchiveDoneOrgFile

Returns a new instance of ArchiveDoneOrgFile.



8
9
10
# File 'lib/org_mode/processors/archive_done.rb', line 8

def initialize(org_file)
  super(org_file)
end

Instance Method Details

#archived_root_nodeObject



12
13
14
# File 'lib/org_mode/processors/archive_done.rb', line 12

def archived_root_node
  select_by_title(/^Archived$/, :stars => 1).first
end

#create_archived_root_nodeObject



16
17
18
19
20
21
22
23
24
25
# File 'lib/org_mode/processors/archive_done.rb', line 16

def create_archived_root_node
  self.root_nodes << OrgMode::Node.new.tap do |n|
    n.title = "Archived"
    n.content = <<-eos.strip_indent(10)
    This node contains archived items. Appended
    due to calling the script with update --archive-done
    eos
    n.stars = 1
  end
end

#move_done_trees_to_archived_root_nodeObject



27
28
29
30
31
32
33
# File 'lib/org_mode/processors/archive_done.rb', line 27

def move_done_trees_to_archived_root_node
  processed_nodes = []
  self.nodes.each do |n|
    # if not done move to processed nodes
    # if done append to archived_root_node
  end
end