class PactBroker::Api::Decorators::CustomErrorProblemJsonDecorator
Public Class Methods
Source
# File lib/pact_broker/api/decorators/custom_error_problem_json_decorator.rb, line 12 def initialize(title:, type:, detail:, status: ) @title = title @type = type @detail = detail @status = status end
@option title [String] @option type [String] @option detail [String] @option status [Integer] HTTP status code
Public Instance Methods
Source
# File lib/pact_broker/api/decorators/custom_error_problem_json_decorator.rb, line 20 def to_hash(user_options: {}, **__other) { "title" => @title, "type" => "#{user_options[:base_url]}/problem/#{@type}", "detail" => @detail, "status" => @status } end
@return [Hash]
Source
# File lib/pact_broker/api/decorators/custom_error_problem_json_decorator.rb, line 30 def to_json(*args, **kwargs) to_hash(*args, **kwargs).to_json end
@return [String] JSON