Permalink
Browse files

No need to split values of dimensions or metrics on the colon charact…

…er. This was causing a bug whenever a value contained a colon.
  • Loading branch information...
1 parent bb99363 commit 0d545c6ae592d393b344aaafd74770e125c6405b @jasonfox committed Mar 13, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/gattica/data_point.rb
View
4 lib/gattica/data_point.rb
@@ -17,10 +17,10 @@ def initialize(xml)
@updated = DateTime.parse(xml.at('updated').inner_html)
@title = xml.at('title').inner_html
@dimensions = xml.search('dxp:dimension').collect do |dimension|
- { dimension.attributes['name'].split(':').last.to_sym => dimension.attributes['value'].split(':').last }
+ { dimension.attributes['name'].split(':').last.to_sym => dimension.attributes['value'] }
end
@metrics = xml.search('dxp:metric').collect do |metric|
- { metric.attributes['name'].split(':').last.to_sym => metric.attributes['value'].split(':').last.to_f }
+ { metric.attributes['name'].split(':').last.to_sym => metric.attributes['value'].to_f }
end
end

0 comments on commit 0d545c6

Please sign in to comment.