Class: PactBroker::Api::Decorators::RuntimeErrorProblemJsonDecorator
- Inherits:
-
Object
- Object
- PactBroker::Api::Decorators::RuntimeErrorProblemJsonDecorator
- Defined in:
- lib/pact_broker/api/decorators/runtime_error_problem_json_decorator.rb
Instance Method Summary collapse
-
#initialize(message) ⇒ RuntimeErrorProblemJsonDecorator
constructor
A new instance of RuntimeErrorProblemJsonDecorator.
- #to_hash(user_options:) ⇒ Hash
-
#to_json(*args, **kwargs) ⇒ String
JSON.
Constructor Details
#initialize(message) ⇒ RuntimeErrorProblemJsonDecorator
Returns a new instance of RuntimeErrorProblemJsonDecorator.
9 10 11 |
# File 'lib/pact_broker/api/decorators/runtime_error_problem_json_decorator.rb', line 9 def initialize() @message = end |
Instance Method Details
#to_hash(user_options:) ⇒ Hash
14 15 16 17 18 19 20 21 |
# File 'lib/pact_broker/api/decorators/runtime_error_problem_json_decorator.rb', line 14 def to_hash(user_options:, **) { "title" => "Server error", "type" => "#{[:base_url]}/problems/server-error", "detail" => , "status" => 500 } end |
#to_json(*args, **kwargs) ⇒ String
Returns JSON.
24 25 26 |
# File 'lib/pact_broker/api/decorators/runtime_error_problem_json_decorator.rb', line 24 def to_json(*args, **kwargs) to_hash(*args, **kwargs).to_json end |