Class: RSpec::Matchers::MatcherDelegator
- Includes:
- Composable
- Defined in:
- lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/matchers/matcher_delegator.rb
Overview
Provides the necessary plumbing to wrap a matcher with a decorator.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#base_matcher ⇒ Object
readonly
Returns the value of attribute base_matcher.
Instance Method Summary collapse
-
#initialize(base_matcher) ⇒ MatcherDelegator
constructor
A new instance of MatcherDelegator.
- #initialize_copy(other) ⇒ Object
- #method_missing(*args, &block) ⇒ Object
-
#respond_to?(name, include_all = false) ⇒ Boolean
:nocov:.
- #respond_to_missing?(name, include_all = false) ⇒ Boolean
Methods included from Composable
#===, #and, #description_of, #or, should_enumerate?, surface_descriptions_in, unreadable_io?, #values_match?
Constructor Details
#initialize(base_matcher) ⇒ MatcherDelegator
Returns a new instance of MatcherDelegator.
9 10 11 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/matchers/matcher_delegator.rb', line 9 def initialize(base_matcher) @base_matcher = base_matcher end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*args, &block) ⇒ Object
13 14 15 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/matchers/matcher_delegator.rb', line 13 def method_missing(*args, &block) base_matcher.__send__(*args, &block) end |
Instance Attribute Details
#base_matcher ⇒ Object (readonly)
Returns the value of attribute base_matcher.
7 8 9 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/matchers/matcher_delegator.rb', line 7 def base_matcher @base_matcher end |
Instance Method Details
#initialize_copy(other) ⇒ Object
29 30 31 32 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/matchers/matcher_delegator.rb', line 29 def initialize_copy(other) @base_matcher = @base_matcher.clone super end |
#respond_to?(name, include_all = false) ⇒ Boolean
:nocov:
23 24 25 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/matchers/matcher_delegator.rb', line 23 def respond_to?(name, include_all=false) super || base_matcher.respond_to?(name, include_all) end |
#respond_to_missing?(name, include_all = false) ⇒ Boolean
18 19 20 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/matchers/matcher_delegator.rb', line 18 def respond_to_missing?(name, include_all=false) super || base_matcher.respond_to?(name, include_all) end |