Module: Naught::StubStrategy::ReturnNil 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 nil from any method

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 nil

Parameters:

  • subject (Module, Class)

    target to define method on

  • name (Symbol)

    method name to define



13
14
15
# File 'lib/naught/stub_strategy.rb', line 13

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