Class: Sinclair::Matchers::AddClassMethod Private
- Inherits:
-
AddMethod
- Object
- RSpec::Matchers::BuiltIn::BaseMatcher
- AddMethod
- Sinclair::Matchers::AddClassMethod
- Defined in:
- lib/sinclair/matchers/add_class_method.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
AddClassMethod is able to build an instance of AddClassMethodTo
Instance Method Summary collapse
-
#matches?(_actual) ⇒ Boolean
abstract
private
Raise a warning on the usage as this is only a builder for AddClassMethodTo.
-
#to(target = nil) ⇒ AddClassMethodTo
private
Creates a matcher AddClassMethodTo.
Methods inherited from AddMethod
#equal?, #initialize, #supports_block_expectations?
Constructor Details
This class inherits a constructor from Sinclair::Matchers::AddMethod
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.
Raise a warning on the usage as this is only a builder for AddClassMethodTo
40 41 42 43 |
# File 'lib/sinclair/matchers/add_class_method.rb', line 40 def matches?(_actual) raise SyntaxError, 'You should specify which class the method is being added to' \ "add_class_method(:#{method}).to(klass)" end |
#to(target = nil) ⇒ AddClassMethodTo
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.
Creates a matcher Sinclair::Matchers::AddClassMethodTo
51 52 53 |
# File 'lib/sinclair/matchers/add_class_method.rb', line 51 def to(target = nil) AddClassMethodTo.new(target, method) end |