Module: ResourceFull::CoreExtensions::Exception
- Included in:
- Exception
- Defined in:
- lib/resource_full/core_extensions/exception.rb
Instance Method Summary collapse
Instance Method Details
#to_json(options = {}) ⇒ Object
15 16 17 18 |
# File 'lib/resource_full/core_extensions/exception.rb', line 15 def to_json( = {}) {"error" => {:text => self.to_s, :backtrace => self.backtrace}}.to_json end |
#to_xml(options = {}) ⇒ Object
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/resource_full/core_extensions/exception.rb', line 4 def to_xml( = {}) [:indent] ||= 2 [:builder] ||= Builder::XmlMarkup.new(:indent => [:indent]) [:builder].instruct! unless [:skip_instruct] [:builder].errors { [:builder].error self.to_s [:builder].error self.backtrace if [:include_backtrace] == true } end |