class Vanity::Metric::GoogleAnalytics::Resource

Attributes

profile[R]

GA profile used for this report. Populated after calling results.

Public Class Methods

new(web_property_id, metric) click to toggle source
# File lib/vanity/metric/google_analytics.rb, line 65
def initialize(web_property_id, metric)
  self.class.send :include, Garb::Resource
  @web_property_id = web_property_id
  metrics metric
  dimensions :date
  sort :date
end

Public Instance Methods

results(start_date, end_date) click to toggle source
# File lib/vanity/metric/google_analytics.rb, line 73
def results(start_date, end_date)
  @profile = Garb::Profile.all.find { |p| p.web_property_id == @web_property_id }
  @start_date = start_date
  @end_date = end_date
  Garb::ReportResponse.new(send_request_for_body).results
end