Class: Bristow::Terminations::MaxMessages

Inherits:
Bristow::Termination show all
Defined in:
lib/bristow/terminations/max_messages.rb

Instance Method Summary collapse

Constructor Details

#initialize(max_messages) ⇒ MaxMessages

Returns a new instance of MaxMessages.



4
5
6
# File 'lib/bristow/terminations/max_messages.rb', line 4

def initialize(max_messages)
  @max_messages = max_messages
end

Instance Method Details

#continue?(messages) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/bristow/terminations/max_messages.rb', line 8

def continue?(messages)
  messages.size < @max_messages
end