Class: HttpStub::Server::Stub::Match::StringValueMatcher
- Inherits:
-
Object
- Object
- HttpStub::Server::Stub::Match::StringValueMatcher
- Defined in:
- lib/http_stub/server/stub/match/string_value_matcher.rb
Instance Method Summary collapse
-
#initialize(stub_value) ⇒ StringValueMatcher
constructor
A new instance of StringValueMatcher.
- #matches?(actual_value) ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(stub_value) ⇒ StringValueMatcher
Returns a new instance of StringValueMatcher.
16 17 18 |
# File 'lib/http_stub/server/stub/match/string_value_matcher.rb', line 16 def initialize(stub_value) @stub_match_value = stub_value ? stub_value.to_s : stub_value end |
Instance Method Details
#matches?(actual_value) ⇒ Boolean
20 21 22 |
# File 'lib/http_stub/server/stub/match/string_value_matcher.rb', line 20 def matches?(actual_value) !!MATCHERS.find { |matcher| matcher.match?(@stub_match_value, actual_value) } end |
#to_s ⇒ Object
24 25 26 |
# File 'lib/http_stub/server/stub/match/string_value_matcher.rb', line 24 def to_s @stub_match_value end |