Module: Naught::StubStrategy::ReturnSelf Private

Defined in:
lib/naught/stub_strategy.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Stub that returns self from any method (black hole)

Class Method Summary collapse

Class Method Details

.apply(subject, name) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Define a method that returns self

Parameters:

  • subject (Module, Class)

    target to define method on

  • name (Symbol)

    method name to define



25
26
27
# File 'lib/naught/stub_strategy.rb', line 25

def self.apply(subject, name)
  subject.define_method(name) { |*, **, &| self }
end