Module: Doing::WWIDInteractive

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

Overview

Interactive methods for WWID class

Instance Method Summary collapse

Instance Method Details

#act_on(items, opt) ⇒ Object

Perform actions on a set of entries. If no valid action is included in the opt hash and the terminal is a TTY, a menu will be presented

Parameters:

  • items (Array)

    Array of Items to affect

  • opt (Hash)

    Options and actions to perform

Options Hash (opt):

  • :editor (Boolean)
  • :delete (Boolean)
  • :tag (String)
  • :flag (Boolean)
  • :finish (Boolean)
  • :cancel (Boolean)
  • :archive (Boolean)
  • :output (String)
  • :save_to (String)
  • :again (Boolean)
  • :resume (Boolean)

#choose_section(include_all: false) ⇒ String

Generate a menu of sections and allow user selection

Returns:

  • (String)

    The selected section name

#choose_section_tagString

Generate a menu of sections and tags and allow user selection

Returns:

  • (String)

    The selected section or tag name

#choose_tag(section = 'All', items: nil, include_all: false) ⇒ String

Generate a menu of tags and allow user selection

Returns:

  • (String)

    The selected tag name

#choose_viewString

Generate a menu of views and allow user selection

Returns:

  • (String)

    The selected view name

#interactive(opt) ⇒ Object

Display an interactive menu of entries

Options hash is shared with #filter_items and #act_on

Parameters:

  • opt (Hash)

    Additional options

Raises:

  • (NoResults)

#verify_duration(date, finish_date, title: nil) ⇒ Object

Interactively verify an item modification if elapsed time is greater than configured threshold

Parameters:

  • date (String)

    Item date

  • finish_date (String)

    The finish date

  • title (String) (defaults to: nil)

    The Item title