Module: RFC::API::Problem
- Defined in:
- lib/rfc/api/problem.rb,
lib/rfc/api/problem/payload.rb,
lib/rfc/api/problem/xml/serializer.rb,
lib/rfc/api/problem/xml/deserializer.rb
Overview
Defined Under Namespace
Modules: XML
Classes: Payload
Constant Summary
collapse
- MEDIA_TYPE_JSON =
"application/problem+json"
- MEDIA_TYPE_XML =
"application/problem+xml"
- TYPES =
%i[json xml].freeze
- PRIMARY_KEYS =
%i[title type status detail instance].freeze
Class Method Summary
collapse
Class Method Details
.[] ⇒ Object
15
|
# File 'lib/rfc/api/problem.rb', line 15
def self.[](**) = Payload.for(**)
|
.from_json ⇒ Object
19
|
# File 'lib/rfc/api/problem.rb', line 19
def self.from_json(...) = Payload.from_json(...)
|
.from_xml ⇒ Object
21
|
# File 'lib/rfc/api/problem.rb', line 21
def self.from_xml(...) = Payload.from_xml(...)
|
23
24
25
|
# File 'lib/rfc/api/problem.rb', line 23
def self.media_type_for key, types: TYPES
types.include?(key) ? const_get("MEDIA_TYPE_#{key.upcase}") : ""
end
|
.new ⇒ Object
17
|
# File 'lib/rfc/api/problem.rb', line 17
def self.new(**) = Payload.for(**)
|