Module: Anyt::ConnectHandlers

Defined in:
lib/anyt/ext/minitest.rb

Overview

Custom #connect handlers management

Class Method Summary collapse

Class Method Details

.add(tag, &block) ⇒ Object



65
66
67
# File 'lib/anyt/ext/minitest.rb', line 65

def add(tag, &block)
  handlers << [tag, block]
end

.call(connection) ⇒ Object



58
59
60
61
62
63
# File 'lib/anyt/ext/minitest.rb', line 58

def call(connection)
  handlers_for(connection).each do |(_, handler)|
    connection.reject_unauthorized_connection unless
      connection.instance_eval(&handler)
  end
end