We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1dea49e commit a17f3abCopy full SHA for a17f3ab
1 file changed
lib/jsonapi/error.rb
@@ -18,6 +18,12 @@ def initialize(options = {})
18
@status = Rack::Utils::SYMBOL_TO_STATUS_CODE[options[:status]].to_s
19
@meta = options[:meta]
20
end
21
+
22
+ def to_hash
23
+ hash = {}
24
+ instance_variables.each {|var| hash[var.to_s.delete('@')] = instance_variable_get(var) unless instance_variable_get(var).nil? }
25
+ hash
26
+ end
27
28
29
class Warning
@@ -31,5 +37,11 @@ def initialize(options = {})
31
37
options[:code]
32
38
33
39
40
41
42
43
44
45
34
46
35
47
0 commit comments