Class: Glyptodont::Checkers::Counter

Inherits:
Object
  • Object
show all
Defined in:
lib/glyptodont/checkers/counter.rb

Overview

Checks that the number of TODOs is below the specified threshold

Instance Method Summary collapse

Constructor Details

#initialize(todos:, threshold:) ⇒ Counter

Returns a new instance of Counter.



7
8
9
10
# File 'lib/glyptodont/checkers/counter.rb', line 7

def initialize(todos:, threshold:)
  @threshold = threshold
  @todos = todos
end

Instance Method Details

#checkObject



12
13
14
# File 'lib/glyptodont/checkers/counter.rb', line 12

def check
  message
end

#passed?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/glyptodont/checkers/counter.rb', line 16

def passed?
  count <= threshold
end