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.



94
95
96
# File 'lib/webmock/request_pattern.rb', line 94

def initialize(pattern)
  @pattern = pattern
end

Instance Method Details

#matches?(method) ⇒ Boolean

Returns:

  • (Boolean)


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

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

#to_sObject



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

def to_s
  @pattern.to_s
end