Class: PactBroker::Api::Decorators::RepresentablePact

Inherits:
Object
  • Object
show all
Defined in:
lib/pact_broker/api/decorators/representable_pact.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pact) ⇒ RepresentablePact

Returns a new instance of RepresentablePact.



12
13
14
15
16
17
18
19
20
# File 'lib/pact_broker/api/decorators/representable_pact.rb', line 12

def initialize pact
  @consumer_version = pact.consumer_version
  @consumer_version_number = pact.consumer_version.number
  @consumer = OpenStruct.new(:version => @consumer_version, :name => pact.consumer.name)
  @provider = OpenStruct.new(:version => nil, :name => pact.provider.name)
  @consumer_name = pact.consumer.name
  @provider_name = pact.provider.name
  @created_at = pact.created_at
end

Instance Attribute Details

#consumerObject (readonly)

Returns the value of attribute consumer.



10
11
12
# File 'lib/pact_broker/api/decorators/representable_pact.rb', line 10

def consumer
  @consumer
end

#consumer_nameObject (readonly)

Returns the value of attribute consumer_name.



10
11
12
# File 'lib/pact_broker/api/decorators/representable_pact.rb', line 10

def consumer_name
  @consumer_name
end

#consumer_versionObject (readonly)

Returns the value of attribute consumer_version.



10
11
12
# File 'lib/pact_broker/api/decorators/representable_pact.rb', line 10

def consumer_version
  @consumer_version
end

#consumer_version_numberObject (readonly)

Returns the value of attribute consumer_version_number.



10
11
12
# File 'lib/pact_broker/api/decorators/representable_pact.rb', line 10

def consumer_version_number
  @consumer_version_number
end

#created_atObject (readonly)

Returns the value of attribute created_at.



10
11
12
# File 'lib/pact_broker/api/decorators/representable_pact.rb', line 10

def created_at
  @created_at
end

#providerObject (readonly)

Returns the value of attribute provider.



10
11
12
# File 'lib/pact_broker/api/decorators/representable_pact.rb', line 10

def provider
  @provider
end

#provider_nameObject (readonly)

Returns the value of attribute provider_name.



10
11
12
# File 'lib/pact_broker/api/decorators/representable_pact.rb', line 10

def provider_name
  @provider_name
end