class Nucleo::Models::FeedTypes::Analytics::Page::Pages

Constants

DIMENSION_NAME
METRIC_NAME

Public Instance Methods

any?() click to toggle source
# File lib/nucleo/models/feed_types/analytics/page/pages.rb, line 41
def any?
  self.current_period.rows?
end
current_period() click to toggle source

Delegates to the Metric Period

@return [Nucleo::Models::MetricPeriod]

# File lib/nucleo/models/feed_types/analytics/page/pages.rb, line 37
def current_period
  self.metric.metric_periods.current_period
end
metric() click to toggle source

Returns the specific Metric for this page

@return [Nucleo::Models::Metric]

# File lib/nucleo/models/feed_types/analytics/page/pages.rb, line 14
def metric
  params = {
    'metric'         => METRIC_NAME,
    'dimension'      => DIMENSION_NAME,
    'classification' => @attributes['classification'],
    'totals'         => data['totals'],
    'current_period' => data['current_period'],
    'prior_period'   => data['prior_period']
  }

  Nucleo::Models::Metric.new(params)
end
previous_period()
Alias for: prior_period
prior_period() click to toggle source

Delegates to the Metric Period

@return [Nucleo::Models::MetricPeriod]

# File lib/nucleo/models/feed_types/analytics/page/pages.rb, line 48
def prior_period
  self.metric.metric_periods.prior_period
end
Also aliased as: previous_period
totals() click to toggle source

Delegates to the Totals

@return [Nucleo::Models::MetricPeriodsTotals]

# File lib/nucleo/models/feed_types/analytics/page/pages.rb, line 30
def totals
  self.metric.metric_periods.totals
end