class TodoLint::Judge

Is this todo worth bothering the user about? Judge the todo, and charge it with a crime if necessary

Attributes

charge[R]

The problem, if any, with this todo @example

judge.charge #=> "The todo is overly dramatic"

@return [String] if the todo has something going on with it @return [NilClass] if the todo is fine @api public

todo[R]

Which todo is being judged?

@return [Todo] @api private

Public Class Methods

new(todo) click to toggle source

Accept and judge a todo @example

Judge.new(todo)

@api public

# File lib/todo_lint/judge.rb, line 17
def initialize(todo)
  @todo = todo
  @charge = make_charge
end

Private Instance Methods

make_charge() click to toggle source

What is the problem with this todo?

@return [String] if there's a problem @return [NilClass] if no charge needed @api private

# File lib/todo_lint/judge.rb, line 35
def make_charge
  if !todo.annotated?
    "Missing due date annotation"
  elsif todo.due_date.overdue? && todo.tag?
    "Overdue due date #{todo.due_date.to_date} via tag"
  elsif todo.due_date.overdue?
    "Overdue due date"
  end
end