class Jahuty::Resource::Problem
An application/problem+json response. The API should respond with a problem whenever a client- or server-error occurs.
Attributes
detail[RW]
status[RW]
type[RW]
Public Class Methods
from(data)
click to toggle source
# File lib/jahuty/resource/problem.rb, line 16 def self.from(data) raise ArgumentError.new, 'Key :status missing' unless data.key?(:status) raise ArgumentError.new, 'Key :type missing' unless data.key?(:type) raise ArgumentError.new, 'Key :detail missing' unless data.key?(:detail) Problem.new(**data.slice(:status, :type, :detail)) end
new(status:, type:, detail:)
click to toggle source
# File lib/jahuty/resource/problem.rb, line 10 def initialize(status:, type:, detail:) @status = status @type = type @detail = detail end