Class: Pact::ServiceProvider
- Inherits:
-
Object
- Object
- Pact::ServiceProvider
show all
- Includes:
- SymbolizeKeys
- Defined in:
- lib/pact/consumer_contract/service_provider.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
included, #symbolize_keys
Constructor Details
Returns a new instance of ServiceProvider.
8
9
10
|
# File 'lib/pact/consumer_contract/service_provider.rb', line 8
def initialize options
@name = options[:name] || '[provider name unknown - please update the pact gem in the consumer project to the latest version and regenerate the pacts]'
end
|
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
7
8
9
|
# File 'lib/pact/consumer_contract/service_provider.rb', line 7
def name
@name
end
|
Class Method Details
.from_hash(hash) ⇒ Object
24
25
26
|
# File 'lib/pact/consumer_contract/service_provider.rb', line 24
def self.from_hash hash
new(symbolize_keys(hash))
end
|
Instance Method Details
#as_json(options = {}) ⇒ Object
20
21
22
|
# File 'lib/pact/consumer_contract/service_provider.rb', line 20
def as_json options = {}
to_hash
end
|
#to_hash ⇒ Object
16
17
18
|
# File 'lib/pact/consumer_contract/service_provider.rb', line 16
def to_hash
{name: name}
end
|
#to_s ⇒ Object
12
13
14
|
# File 'lib/pact/consumer_contract/service_provider.rb', line 12
def to_s
name
end
|