We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 456fd44 commit c4e9aeeCopy full SHA for c4e9aee
lib/esdb.rb
@@ -9,6 +9,14 @@ def initialize(stats)
9
values = value.join(',')
10
elsif value === true
11
values = 'avg'
12
+ elsif value.is_a?(Hash)
13
+ values = value.collect{|calc, conds|
14
+ if conds[0].is_a?(Array)
15
+ conds.collect{|_conds| "#{calc}:[#{_conds.join(',')}]"}.join(',')
16
+ else
17
+ "#{calc}:[#{conds.join(',')}]"
18
+ end
19
+ }.join(',')
20
else
21
values = value
22
end
lib/esdb/resource.rb
@@ -40,7 +40,7 @@ def get!(*args)
40
@response = get(*args)
41
42
43
- def json
+ def to_hash
44
get! unless @response
45
JSON.parse(@response)
46
0 commit comments