Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

To hash for point

  • Loading branch information...
commit c85cb929f17733cab660a49b81fed61233e1ff94 1 parent 7bc96c0
@vgololobov authored
Showing with 9 additions and 6 deletions.
  1. +9 −6 lib/gattica/data_point.rb
View
15 lib/gattica/data_point.rb
@@ -56,12 +56,15 @@ def to_yaml
'metrics' => @metrics }.to_yaml
end
- def to_hash
- { :id => @id,
- :updated => @updated,
- :title => @title,
- :dimensions => @dimensions,
- :metrics => @metrics }
+ def to_hash
+
+ res_hash = {}
+
+ @dimensions.each{|d| res_hash.merge!(d) }
+ # output all metrics
+ @metrics.each{|m| res_hash.merge!(m) }
+ res_hash
+
end
Please sign in to comment.
Something went wrong with that request. Please try again.