Class: Pact::Generators::MockServerURLGenerator

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/pact/generators/base.rb

Instance Method Summary collapse

Constructor Details

#initialize(regex:, example:) ⇒ MockServerURLGenerator

Returns a new instance of MockServerURLGenerator.



269
270
271
272
# File 'lib/pact/generators/base.rb', line 269

def initialize(regex:, example:)
  @regex = regex
  @example = example
end

Instance Method Details

#as_basicObject



274
275
276
277
278
279
280
281
282
# File 'lib/pact/generators/base.rb', line 274

def as_basic
  {
    "pact:generator:type" => "MockServerURL",
    "pact:matcher:type" => "regex",
    "regex" => @regex,
    "example" => @example,
    "value" => @example
  }
end