Class: PactBroker::Api::Decorators::ValidationErrorsDecorator
- Inherits:
-
Object
- Object
- PactBroker::Api::Decorators::ValidationErrorsDecorator
- Defined in:
- lib/pact_broker/api/decorators/validation_errors_decorator.rb
Instance Method Summary collapse
-
#initialize(errors) ⇒ ValidationErrorsDecorator
constructor
A new instance of ValidationErrorsDecorator.
- #to_hash(*_args, **_kwargs) ⇒ Hash
-
#to_json(*args, **kwargs) ⇒ String
JSON.
Constructor Details
#initialize(errors) ⇒ ValidationErrorsDecorator
Returns a new instance of ValidationErrorsDecorator.
10 11 12 |
# File 'lib/pact_broker/api/decorators/validation_errors_decorator.rb', line 10 def initialize(errors) @errors = errors end |
Instance Method Details
#to_hash(*_args, **_kwargs) ⇒ Hash
15 16 17 |
# File 'lib/pact_broker/api/decorators/validation_errors_decorator.rb', line 15 def to_hash(*_args, **_kwargs) { errors: errors } end |
#to_json(*args, **kwargs) ⇒ String
Returns JSON.
20 21 22 |
# File 'lib/pact_broker/api/decorators/validation_errors_decorator.rb', line 20 def to_json(*args, **kwargs) to_hash(*args, **kwargs).to_json end |