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.



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

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

Instance Attribute Details

#consumerObject (readonly)

Returns the value of attribute consumer.



8
9
10
# File 'lib/pact_broker/api/decorators/representable_pact.rb', line 8

def consumer
  @consumer
end

#consumer_versionObject (readonly)

Returns the value of attribute consumer_version.



8
9
10
# File 'lib/pact_broker/api/decorators/representable_pact.rb', line 8

def consumer_version
  @consumer_version
end

#created_atObject (readonly)

Returns the value of attribute created_at.



8
9
10
# File 'lib/pact_broker/api/decorators/representable_pact.rb', line 8

def created_at
  @created_at
end

#providerObject (readonly)

Returns the value of attribute provider.



8
9
10
# File 'lib/pact_broker/api/decorators/representable_pact.rb', line 8

def provider
  @provider
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



8
9
10
# File 'lib/pact_broker/api/decorators/representable_pact.rb', line 8

def updated_at
  @updated_at
end