Class: TrelloTool::Health

Inherits:
Object
  • Object
show all
Defined in:
lib/trello_tool/health.rb

Overview

Health analysis of a board

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(board, configuration) ⇒ Health

Returns a new instance of Health.



8
9
10
11
12
13
14
15
# File 'lib/trello_tool/health.rb', line 8

def initialize(board, configuration)
  @board = board
  @configuration = configuration
  @symbols_and_colours = []
  @unexpected = []
  @expected_lists = {}
  analyze
end

Instance Attribute Details

#boardObject (readonly)

Returns the value of attribute board.



6
7
8
# File 'lib/trello_tool/health.rb', line 6

def board
  @board
end

#configurationObject (readonly)

Returns the value of attribute configuration.



6
7
8
# File 'lib/trello_tool/health.rb', line 6

def configuration
  @configuration
end

#expected_listsObject (readonly)

Returns the value of attribute expected_lists.



6
7
8
# File 'lib/trello_tool/health.rb', line 6

def expected_lists
  @expected_lists
end

#symbols_and_coloursObject (readonly)

Returns the value of attribute symbols_and_colours.



6
7
8
# File 'lib/trello_tool/health.rb', line 6

def symbols_and_colours
  @symbols_and_colours
end

#unexpectedObject (readonly)

Returns the value of attribute unexpected.



6
7
8
# File 'lib/trello_tool/health.rb', line 6

def unexpected
  @unexpected
end

Instance Method Details

#each_expected_list_with_lengthObject



25
26
27
28
29
# File 'lib/trello_tool/health.rb', line 25

def each_expected_list_with_length
  expected_lists.each do |name, value|
    yield name, value[:length]
  end
end

#each_issue_with_severity {|todo_list_issue| ... } ⇒ Object

Yields:

  • (todo_list_issue)


17
18
19
20
21
22
23
# File 'lib/trello_tool/health.rb', line 17

def each_issue_with_severity
  unexpected.each do |list, index|
    yield list.name.inspect, "Unexpected @ ##{index + 1}"
  end
  yield todo_list_issue if todo_list_issue
  yield doing_list_issue if doing_list_issue
end