Class: PactBroker::Api::Decorators::ReasonDecorator

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

Instance Method Summary collapse

Constructor Details

#initialize(reason) ⇒ ReasonDecorator

Returns a new instance of ReasonDecorator.



7
8
9
10
11
12
13
14
15
# File 'lib/pact_broker/api/decorators/reason_decorator.rb', line 7

def initialize(reason)
  if reason.is_a?(PactBroker::Matrix::IgnoredReason)
    @reason = reason.root_reason
    @ignored = true
  else
    @reason = reason
    @ignored = false
  end
end

Instance Method Details

#to_sObject



17
18
19
# File 'lib/pact_broker/api/decorators/reason_decorator.rb', line 17

def to_s
  (ignored ? "Ignoring: " : "") + reason_text
end