Module: Danger::Helpers::MessageGroupsArrayHelper

Defined in:
lib/danger/helpers/message_groups_array_helper.rb

Defined Under Namespace

Classes: FakeArray

Instance Method Summary collapse

Instance Method Details

#countsObject



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/danger/helpers/message_groups_array_helper.rb', line 18

def counts
  return @counts if @counts

  @counts = { warnings: 0, errors: 0 }
  each do |message_group, counts|
    group_stats = message_group.stats
    @counts[:warnings] += group_stats[:warnings_count]
    @counts[:errors] += group_stats[:errors_count]
  end
  @counts
end

#fake_errors_arrayObject



14
15
16
# File 'lib/danger/helpers/message_groups_array_helper.rb', line 14

def fake_errors_array
  FakeArray.new(counts[:errors])
end

#fake_warnings_arrayObject



10
11
12
# File 'lib/danger/helpers/message_groups_array_helper.rb', line 10

def fake_warnings_array
  FakeArray.new(counts[:warnings])
end