Class: Doing::Item
- Defined in:
- lib/doing/item/item.rb
Overview
This class describes a single WWID item
Constant Summary
Constants included from Color
Color::ATTRIBUTES, Color::ATTRIBUTE_NAMES, Color::ESCAPE_REGEX
Instance Attribute Summary collapse
- 
  
    
      #date  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Returns the value of attribute date. 
- 
  
    
      #id  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Returns the value of attribute id. 
- 
  
    
      #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
- #clone ⇒ Object
- 
  
    
      #equal?(other, match_section: false)  ⇒ Boolean 
    
    
  
  
  
  
  
  
  
  
  
    Test for equality between items. 
- #gen_id ⇒ Object
- 
  
    
      #initialize(date, title, section, note = nil, id = nil)  ⇒ Item 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    Initialize an item with date, title, section, and optional note. 
- 
  
    
      #move_to(new_section, label: true, log: true)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Move item from current section to destination section. 
- 
  
    
      #to_pretty(elements: %i[date title section]))  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    outputs a colored string with relative date and highlighted tags. 
- 
  
    
      #to_s  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    outputs item in Doing file format, including leading tab. 
Methods included from Color
attributes, coloring?, #rgb, #support?, template, uncolor, #uncolor
Methods included from ItemTags
#tag, #tag_array, #tags, #tags_with_values
Methods included from ItemState
#finished?, #should_finish?, #should_time?, #unfinished?
Methods included from ItemQuery
#highlight_search, #ignore_case, #keep_item?, #search, #tag_values?, #tags?
Methods included from ItemDates
#calculate_end_date, #duration, #end_date, #expand_date_tags, #interval, #overlapping_time?, #same_time?
Constructor Details
#initialize(date, title, section, note = nil, id = nil) ⇒ Item
Initialize an item with date, title, section, and optional note
Instance Attribute Details
#date ⇒ Object
Returns the value of attribute date.
#id ⇒ Object
Returns the value of attribute id.
#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
#clone ⇒ Object
#equal?(other, match_section: false) ⇒ Boolean
Test for equality between items
#gen_id ⇒ Object
#move_to(new_section, label: true, log: true) ⇒ Object
Move item from current section to destination section
#to_pretty(elements: %i[date title section])) ⇒ Object
outputs a colored string with relative date and highlighted tags
#to_s ⇒ Object
outputs item in Doing file format, including leading tab