From 2babec4ef313d876834b158f71214cf3747c3771 Mon Sep 17 00:00:00 2001 From: Brian van Burken Date: Wed, 28 May 2014 19:54:59 +0200 Subject: [PATCH] Moved long assignment into smaller more readable lines. --- app/models/error_report.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/models/error_report.rb b/app/models/error_report.rb index 3ea4709..c8bee9c 100644 --- a/app/models/error_report.rb +++ b/app/models/error_report.rb @@ -23,8 +23,10 @@ class ErrorReport end def initialize(xml_or_attributes) - @attributes = (xml_or_attributes.is_a?(String) ? Hoptoad.parse_xml!(xml_or_attributes) : xml_or_attributes).with_indifferent_access - @attributes.each{|k, v| instance_variable_set(:"@#{k}", v) } + @attributes = xml_or_attributes + @attributes = Hoptoad.parse_xml!(@attributes) if @attributes.is_a? String + @attributes = @attributes.with_indifferent_access + @attributes.each { |k, v| instance_variable_set(:"@#{k}", v) } end def rails_env -- libgit2 0.21.2