Class: AWSCDK::Assertions::Matcher
- Inherits:
-
Jsii::Object
- Object
- Jsii::Object
- AWSCDK::Assertions::Matcher
- Defined in:
- assertions/matcher.rb
Overview
Represents a matcher that can perform special data matching capabilities between a given pattern and a target.
Direct Known Subclasses
Class Method Summary collapse
-
.is_matcher(x) ⇒ Boolean
Check whether the provided object is a subtype of the
IMatcher. - .jsii_overridable_methods ⇒ Object
Instance Method Summary collapse
-
#initialize ⇒ Matcher
constructor
A new instance of Matcher.
-
#name ⇒ String
A name for the matcher.
-
#test(actual) ⇒ AWSCDK::Assertions::MatchResult
Test whether a target matches the provided pattern.
Constructor Details
#initialize ⇒ Matcher
Returns a new instance of Matcher.
8 9 10 |
# File 'assertions/matcher.rb', line 8 def initialize Jsii::Object.instance_method(:initialize).bind(self).call end |
Class Method Details
.is_matcher(x) ⇒ Boolean
Check whether the provided object is a subtype of the IMatcher.
23 24 25 26 |
# File 'assertions/matcher.rb', line 23 def self.is_matcher(x) Jsii::Type.check_type(x, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "x") Jsii::Kernel.instance.call_static("aws-cdk-lib.assertions.Matcher", "isMatcher", [x]) end |
.jsii_overridable_methods ⇒ Object
12 13 14 15 16 17 |
# File 'assertions/matcher.rb', line 12 def self.jsii_overridable_methods { :name => { kind: :property, name: "name", is_optional: false }, :test => { kind: :method, name: "test", is_optional: false }, } end |
Instance Method Details
#name ⇒ String
A name for the matcher.
This is collected as part of the result and may be presented to the user.
33 34 35 |
# File 'assertions/matcher.rb', line 33 def name() jsii_get_property("name") end |
#test(actual) ⇒ AWSCDK::Assertions::MatchResult
Test whether a target matches the provided pattern.
Every Matcher must implement this method. This method will be invoked by the assertions framework. Do not call this method directly.
44 45 46 47 |
# File 'assertions/matcher.rb', line 44 def test(actual) Jsii::Type.check_type(actual, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "actual") jsii_call_method("test", [actual]) end |