Class: PactBroker::Pacts::VerifiablePact

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/pact_broker/pacts/verifiable_pact.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pact, selectors, pending, pending_provider_tags = [], non_pending_provider_tags = [], wip = false) ⇒ VerifiablePact

TODO refactor this constructor



9
10
11
12
13
14
15
16
# File 'lib/pact_broker/pacts/verifiable_pact.rb', line 9

def initialize(pact, selectors, pending, pending_provider_tags = [], non_pending_provider_tags = [], wip = false)
  super(pact)
  @pending = pending
  @selectors = selectors
  @pending_provider_tags = pending_provider_tags
  @non_pending_provider_tags = non_pending_provider_tags
  @wip = wip
end

Instance Attribute Details

#non_pending_provider_tagsObject (readonly)

Returns the value of attribute non_pending_provider_tags.



6
7
8
# File 'lib/pact_broker/pacts/verifiable_pact.rb', line 6

def non_pending_provider_tags
  @non_pending_provider_tags
end

#pendingObject (readonly)

Returns the value of attribute pending.



6
7
8
# File 'lib/pact_broker/pacts/verifiable_pact.rb', line 6

def pending
  @pending
end

#pending_provider_tagsObject (readonly)

Returns the value of attribute pending_provider_tags.



6
7
8
# File 'lib/pact_broker/pacts/verifiable_pact.rb', line 6

def pending_provider_tags
  @pending_provider_tags
end

#selectorsObject (readonly)

Returns the value of attribute selectors.



6
7
8
# File 'lib/pact_broker/pacts/verifiable_pact.rb', line 6

def selectors
  @selectors
end

#wipObject (readonly)

Returns the value of attribute wip.



6
7
8
# File 'lib/pact_broker/pacts/verifiable_pact.rb', line 6

def wip
  @wip
end

Instance Method Details

#<=>(other) ⇒ Object



26
27
28
29
30
31
32
# File 'lib/pact_broker/pacts/verifiable_pact.rb', line 26

def <=> other
  if self.consumer_name != other.consumer_name
    return self.consumer_name <=> other.consumer_name
  else
    return self.consumer_version.order <=> other.consumer_version.order
  end
end

#pending?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/pact_broker/pacts/verifiable_pact.rb', line 18

def pending?
  pending
end

#wip?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/pact_broker/pacts/verifiable_pact.rb', line 22

def wip?
  wip
end