Module: BlockRepeater::Repeatable

Included in:
BlockRepeater
Defined in:
lib/block_repeater/repeatable.rb

Overview

A nicer way to access the Repeater without setting up the class manually

Instance Method Summary collapse

Instance Method Details

#repeat(**kwargs, &block) ⇒ Object

Create an instance of the Repeater class

Parameters:

  • **kwargs
    • Capture all the keyword arguments, pass them into the Repeater

    Specifically pass through :times and :delay as others will be ignored

  • &block
    • The block of code to be repeated



13
14
15
# File 'lib/block_repeater/repeatable.rb', line 13

def repeat(**kwargs, &block)
  Repeater.new(manual_repeat: false, **kwargs, &block)
end