Class: Pact::Consumer::PactConfig::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/pact/consumer/pact_config/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(consumer_name:, provider_name:, opts: {}) ⇒ Base

Returns a new instance of Base.



9
10
11
12
13
14
# File 'lib/pact/consumer/pact_config/base.rb', line 9

def initialize(consumer_name:, provider_name:, opts: {})
  @consumer_name = consumer_name
  @provider_name = provider_name
  @pact_dir = opts[:pact_dir] || (defined?(Rails) ? Rails.root.join("../pacts").to_s : "pacts")
  @log_level = opts[:log_level] || :info
end

Instance Attribute Details

#consumer_nameObject (readonly)

Returns the value of attribute consumer_name.



7
8
9
# File 'lib/pact/consumer/pact_config/base.rb', line 7

def consumer_name
  @consumer_name
end

#log_levelObject (readonly)

Returns the value of attribute log_level.



7
8
9
# File 'lib/pact/consumer/pact_config/base.rb', line 7

def log_level
  @log_level
end

#pact_dirObject (readonly)

Returns the value of attribute pact_dir.



7
8
9
# File 'lib/pact/consumer/pact_config/base.rb', line 7

def pact_dir
  @pact_dir
end

#provider_nameObject (readonly)

Returns the value of attribute provider_name.



7
8
9
# File 'lib/pact/consumer/pact_config/base.rb', line 7

def provider_name
  @provider_name
end

Instance Method Details

#new_interaction(description = nil) ⇒ Object

Raises:

  • (PactImplementationRequired)


16
17
18
# File 'lib/pact/consumer/pact_config/base.rb', line 16

def new_interaction(description = nil)
  raise PactImplementationRequired, "#new_interaction should be implemented"
end