Module: Doing::WWIDModify

Included in:
WWID
Defined in:
lib/doing/wwid/modify.rb

Overview

Item modification methods for WWID class

Instance Method Summary collapse

Instance Method Details

#add_item(title, section = nil, opt) ⇒ Object

Adds an entry

Parameters:

  • title (String)

    The entry title

  • section (String) (defaults to: nil)

    The section to add to

  • opt (Hash)

    Additional Options

Options Hash (opt):

  • :date (Date)

    item start date

  • :note (Array)

    item note (will be converted if value is String)

  • :back (Date)

    backdate

  • :timed (Boolean)

    new item is timed entry, marks previous entry as @done

  • :done (Date)

    If set, adds a @done tag to new entry

#archive(section = Doing.setting('current_section'), options) ⇒ Object

Move entries from a section to Archive or other specified section

Parameters:

  • section (String) (defaults to: Doing.setting('current_section'))

    The source section

  • options (Hash)

    Options

#autotag(string) ⇒ Object

Uses 'autotag' configuration to turn keywords into tags for time tracking. Does not repeat tags in a title, and only converts the first instance of an untagged keyword

Parameters:

  • string (String)

    The text to tag

#delete_items(items, force: false) ⇒ Object

Delete a set of items from the main index

Parameters:

  • items (Array)

    The items to delete

  • force (Boolean) (defaults to: false)

    Force deletion without confirmation

#repeat_item(item, opt) ⇒ Object

Duplicate an item and add it as a new item

Parameters:

  • item (Item)

    the item to duplicate

  • opt (Hash)

    additional options

Options Hash (opt):

  • :editor (Boolean)

    open new item in editor

  • :date (String)

    set start date

  • :in (String)

    add new item to section :in

  • :note (Note)

    add note to new item

Returns:

  • nothing

#repeat_last(opt) ⇒ Object

Restart the last entry

Parameters:

  • opt (Hash)

    Additional Options

#reset_item(item, date: nil, finish_date: nil, resume: false) ⇒ Object

Reset start date to current time, optionally remove done tag (resume)

Parameters:

  • item (Item)

    the item to reset/resume

  • resume (Boolean) (defaults to: false)

    removing @done tag if true

#stop_start(target_tag, opt) ⇒ Object

Accepts one tag and the raw text of a new item if the passed tag is on any item, it's replaced with @done. if new_item is not nil, it's tagged with the passed tag and inserted. This is for use where only one instance of a given tag should exist (@meanwhile)

Parameters:

  • target_tag (String)

    Tag to replace

  • opt (Hash)

    Additional Options

Options Hash (opt):

  • :section (String)

    target section

  • :archive (Boolean)

    archive old item

  • :back (Date)

    backdate new item

  • :new_item (String)

    content to use for new item

  • :note (Array)

    note content for new item

#tag_last(opt) ⇒ Object

Tag the last entry or X entries

Parameters:

  • opt (Hash)

    Additional Options (see

    filter_items for filtering

    options)

Raises:

  • (NoResults)

See Also:

  • #filter_items