Class: WebMock::MethodPattern

Inherits:
Object
  • Object
show all
Defined in:
lib/webmock/request_pattern.rb

Instance Method Summary collapse

Constructor Details

#initialize(pattern) ⇒ MethodPattern

Returns a new instance of MethodPattern.



99
100
101
# File 'lib/webmock/request_pattern.rb', line 99

def initialize(pattern)
  @pattern = pattern
end

Instance Method Details

#matches?(method) ⇒ Boolean

Returns:

  • (Boolean)


103
104
105
# File 'lib/webmock/request_pattern.rb', line 103

def matches?(method)
  @pattern == method || @pattern == :any
end

#to_sObject



107
108
109
# File 'lib/webmock/request_pattern.rb', line 107

def to_s
  @pattern.to_s
end