Module: Twelve::API::Gauges::Content

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

Overview

The Content module handles top content

Instance Method Summary collapse

Instance Method Details

#content(*args) ⇒ Object

Returns top content 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/content.rb', line 21

def content(*args)
  attributes = {}

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

    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