Class: Doing::Item
- Inherits:
-
Object
- Object
- Doing::Item
- Defined in:
- lib/doing/item.rb
Overview
This class describes a single WWID item
Instance Attribute Summary collapse
-
#date ⇒ Object
Returns the value of attribute date.
-
#id ⇒ String
readonly
Generate a hash that represents the entry.
-
#note ⇒ Object
Returns the value of attribute note.
-
#section ⇒ Object
Returns the value of attribute section.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
-
#end_date ⇒ Time
Get the value of the item's @done tag.
-
#equal?(other) ⇒ Boolean
Test for equality between items.
-
#initialize(date, title, section, note = nil) ⇒ Item
constructor
Initialize an item with date, title, section, and optional note.
-
#interval ⇒ Object
Get the difference between the item's start date and the value of its @done tag (if present).
-
#move_to(new_section, label: true, log: true) ⇒ Object
Move item from current section to destination section.
-
#overlapping_time?(item_b) ⇒ Boolean
Test if the interval between start date and @done value overlaps with another item's.
-
#same_time?(item_b) ⇒ Boolean
Test if two items occur at the same time (same start date and equal duration).
-
#search(search, distance: 3, negate: false, case_type: :smart, fuzzy: false) ⇒ Boolean
Test if item matches search string.
- #should_finish? ⇒ Boolean
- #should_time? ⇒ Boolean
-
#tag(tags, **options) ⇒ Object
Add (or remove) tags from the title of the item.
-
#tags ⇒ Array
Get a list of tags on the item.
-
#tags?(tags, bool = :and, negate: false) ⇒ Boolean
Test if item contains tag(s).
-
#to_s ⇒ Object
outputs item in Doing file format, including leading tab.
Constructor Details
#initialize(date, title, section, note = nil) ⇒ Item
Initialize an item with date, title, section, and optional note
Instance Attribute Details
#date ⇒ Object
Returns the value of attribute date.
#id ⇒ String (readonly)
Generate a hash that represents the entry
#note ⇒ Object
Returns the value of attribute note.
#section ⇒ Object
Returns the value of attribute section.
#title ⇒ Object
Returns the value of attribute title.
Instance Method Details
#end_date ⇒ Time
Get the value of the item's @done tag
#equal?(other) ⇒ Boolean
Test for equality between items
#interval ⇒ Object
Get the difference between the item's start date and the value of its @done tag (if present)
#move_to(new_section, label: true, log: true) ⇒ Object
Move item from current section to destination section
#overlapping_time?(item_b) ⇒ Boolean
Test if the interval between start date and @done value overlaps with another item's
#same_time?(item_b) ⇒ Boolean
Test if two items occur at the same time (same start date and equal duration)
#search(search, distance: 3, negate: false, case_type: :smart, fuzzy: false) ⇒ Boolean
Test if item matches search string
#should_finish? ⇒ Boolean
#should_time? ⇒ Boolean
#tag(tags, **options) ⇒ Object
Add (or remove) tags from the title of the item
#tags ⇒ Array
Get a list of tags on the item
#tags?(tags, bool = :and, negate: false) ⇒ Boolean
Test if item contains tag(s)
#to_s ⇒ Object
outputs item in Doing file format, including leading tab