Module: Twelve::API::Gauges::Terms

Included in:
Proxy
Defined in:
lib/twelve/api/gauges/terms.rb

Overview

The Terms module handles search terms

Instance Method Summary collapse

Instance Method Details

#terms(*args) ⇒ Object

Returns search terms for a gauge

*args - Date string & options hash

Returns json



21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/twelve/api/gauges/terms.rb', line 21

def terms(*args)
  attributes = {}

  connection.get do |request|
    request.url "#{path_prefix}/terms"

    args.each do |arg|
      request.params['page'] = arg[:page].to_s if arg.is_a?(Hash) && arg.has_key?(:page)
      request.params['date'] = arg if arg.is_a?(String)
    end
  end.body
end