Class: ARFormattedError

Inherits:
String
  • Object
show all
Defined in:
lib/restrack/support.rb

Instance Method Summary collapse

Instance Method Details

#to_jsonObject



67
68
69
# File 'lib/restrack/support.rb', line 67

def to_json
  "{\"errors\": [{\"error\": \"#{self}\"}]}"
end

#to_xmlObject

provide this method, as if it is present it will be used to render the xml rather than XmlSimple



64
65
66
# File 'lib/restrack/support.rb', line 64

def to_xml
  "<?xml version=\"1.0\" encoding=\"UTF-8\"?><errors><error>#{self}</error></errors>"
end