Class: PactBroker::Api::Decorators::RepresentablePact
- Inherits:
-
Object
- Object
- PactBroker::Api::Decorators::RepresentablePact
- Defined in:
- lib/pact_broker/api/decorators/representable_pact.rb
Instance Attribute Summary collapse
-
#consumer ⇒ Object
readonly
Returns the value of attribute consumer.
-
#consumer_name ⇒ Object
readonly
Returns the value of attribute consumer_name.
-
#consumer_version ⇒ Object
readonly
Returns the value of attribute consumer_version.
-
#consumer_version_number ⇒ Object
readonly
Returns the value of attribute consumer_version_number.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#provider ⇒ Object
readonly
Returns the value of attribute provider.
-
#provider_name ⇒ Object
readonly
Returns the value of attribute provider_name.
Instance Method Summary collapse
-
#initialize(pact) ⇒ RepresentablePact
constructor
A new instance of RepresentablePact.
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
#consumer ⇒ Object (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_name ⇒ Object (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_version ⇒ Object (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_number ⇒ Object (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_at ⇒ Object (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 |
#provider ⇒ Object (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_name ⇒ Object (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 |