Class: OrgMode::Processors::ArchiveDoneOrgFile
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- OrgMode::Processors::ArchiveDoneOrgFile
- Defined in:
- lib/org_mode/processors/archive_done.rb
Instance Method Summary collapse
- #archived_root_node ⇒ Object
- #create_archived_root_node ⇒ Object
-
#initialize(org_file) ⇒ ArchiveDoneOrgFile
constructor
A new instance of ArchiveDoneOrgFile.
- #move_done_trees_to_archived_root_node ⇒ Object
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_node ⇒ Object
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_node ⇒ Object
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_node ⇒ Object
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 |