Module: Doing::ItemState

Included in:
Item
Defined in:
lib/doing/item/state.rb

Overview

State queries for a Doing entry

Instance Method Summary collapse

Instance Method Details

#finished?Boolean

Test if item has a @done tag

Returns:

  • (Boolean)

    true item has @done tag



9
10
11
# File 'lib/doing/item/state.rb', line 9

def finished?
  tags?('done')
end

#should_finish?Boolean

Test if item is included in never_finish config and thus should not receive a @done tag

Returns:

  • (Boolean)

    item should receive @done tag



28
29
30
# File 'lib/doing/item/state.rb', line 28

def should_finish?
  should?('never_finish')
end

#should_time?Boolean

Test if item is included in never_time config and thus should not receive a date on the @done tag

Returns:

  • (Boolean)

    item should receive @done date



38
39
40
# File 'lib/doing/item/state.rb', line 38

def should_time?
  should?('never_time')
end

#unfinished?Boolean

Test if item does not contain @done tag

Returns:

  • (Boolean)

    true if item is missing @done tag



18
19
20
# File 'lib/doing/item/state.rb', line 18

def unfinished?
  tags?('done', negate: true)
end