Module: Sinclair::Matchers::AddMethod Private

Included in:
AddClassMethod, AddInstanceMethod, ChangeClassMethod, ChangeInstanceMethod
Defined in:
lib/sinclair/matchers/add_method.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.

Commone methods for matchers

Instance Method Summary collapse

Instance Method Details

#matches?(_actual) ⇒ Boolean

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 is abstract.

Raise a warning on the usage as this is only a builder

Returns:

  • (Boolean)

Raises:

  • SyntaxError



23
24
25
# File 'lib/sinclair/matchers/add_method.rb', line 23

def matches?(_actual)
  raise SyntaxError, matcher_error
end

#to(target = nil) ⇒ Sinclair::Matchers::Base

Builds final matcher



14
15
16
# File 'lib/sinclair/matchers/add_method.rb', line 14

def to(target = nil)
  add_method_to_class.new(target, method_name)
end