Class: PactBroker::Api::Decorators::ReasonDecorator
- Inherits:
-
Object
- Object
- PactBroker::Api::Decorators::ReasonDecorator
- Defined in:
- lib/pact_broker/api/decorators/reason_decorator.rb
Instance Method Summary collapse
-
#initialize(reason) ⇒ ReasonDecorator
constructor
A new instance of ReasonDecorator.
- #to_s ⇒ Object
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_s ⇒ Object
17 18 19 |
# File 'lib/pact_broker/api/decorators/reason_decorator.rb', line 17 def to_s (ignored ? "Ignoring: " : "") + reason_text end |