Class: HttpStub::Server::Stub::StringValueMatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/http_stub/server/stub/string_value_matcher.rb

Instance Method Summary collapse

Constructor Details

#initialize(stub_value) ⇒ StringValueMatcher

Returns a new instance of StringValueMatcher.



15
16
17
# File 'lib/http_stub/server/stub/string_value_matcher.rb', line 15

def initialize(stub_value)
  @stub_match_value = stub_value ? stub_value.to_s : stub_value
end

Instance Method Details

#match?(actual_value) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/http_stub/server/stub/string_value_matcher.rb', line 19

def match?(actual_value)
  !!MATCHERS.find { |matcher| matcher.match?(@stub_match_value, actual_value) }
end

#to_sObject



23
24
25
# File 'lib/http_stub/server/stub/string_value_matcher.rb', line 23

def to_s
  @stub_match_value
end