Module: Hinoki::Aggregates
- Defined in:
- lib/hinoki/aggregates.rb
Class Method Summary collapse
-
.all(limit = nil, offset = nil) ⇒ Object
Return a list of all aggregates.
-
.by_name(name, age = nil) ⇒ Object
Return a specific aggregate check.
-
.delete(name) ⇒ Object
Delete an aggregate check.
-
.summarize(name, summarize = nil, results = false) ⇒ Object
Returns the list of aggregates.
Class Method Details
.all(limit = nil, offset = nil) ⇒ Object
Return a list of all aggregates
11 12 13 14 15 16 17 |
# File 'lib/hinoki/aggregates.rb', line 11 def self.all(limit=nil, offset=nil) url = "/aggregates" if limit then url.append("?limit=#{limit}") end if offset then url.append("&offset=#{offset}") end return @conn.get(url) end |
.by_name(name, age = nil) ⇒ Object
Return a specific aggregate check
20 21 22 23 24 25 |
# File 'lib/hinoki/aggregates.rb', line 20 def self.by_name(name, age=nil) url = "/aggregates/#{name}" if age then url.append("?age=#{age}") end return @conn.get(url) end |
.delete(name) ⇒ Object
Delete an aggregate check
28 29 30 |
# File 'lib/hinoki/aggregates.rb', line 28 def self.delete(name) return @conn.delete("/aggregates/#{name}") end |
.summarize(name, summarize = nil, results = false) ⇒ Object
Returns the list of aggregates
33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/hinoki/aggregates.rb', line 33 def self.summarize(name, summarize=nil, results=false) url = "/aggregates" if summarize && results url.append("?summarize=#{summarize}&results=#{results}") elsif summarize url.append("?summarize=#{summarize}") elsif results url.append("?results=#{results}") end return @conn.get(url) end |