Module: Trailblazer::Test::Endpoint

Defined in:
lib/trailblazer/test/endpoint.rb

Overview

DISCUSS: this is not really endpoint related, it’s more like setting a “global” invocation mechanism.

Defined Under Namespace

Modules: Assertion

Class Method Summary collapse

Class Method Details

.module!(receiver, invoke_method:, invoke_method_wtf:) ⇒ Object

DISCUSS: not sure this is the final “technique” to use the global endpoint invoker.



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/trailblazer/test/endpoint.rb', line 6

def self.module!(receiver, invoke_method:, invoke_method_wtf:)
  receiver.class_eval do
    @@INVOKE_METHOD = invoke_method
    @@INVOKE_METHOD_WTF = invoke_method_wtf

    def trailblazer_test_invoke_method
      @@INVOKE_METHOD
    end

    def trailblazer_test_invoke_method_wtf
      @@INVOKE_METHOD_WTF
    end
  end

  Assertion
end