Class: Nucleo::Models::FeedTypes::Analytics::Site::Pages
- Defined in:
- lib/nucleo/models/feed_types/analytics/site/pages.rb
Constant Summary collapse
- DIMENSION_NAME =
'ga:pageviews'.freeze
- METRIC_NAME =
'ga:pageviews'.freeze
Instance Method Summary collapse
- #any? ⇒ Boolean
-
#current_period ⇒ Nucleo::Models::MetricPeriod
Delegates to the Metric Period.
-
#metric ⇒ Nucleo::Models::Metric
Returns the specific Metric for this page.
-
#prior_period ⇒ Nucleo::Models::MetricPeriod
(also: #previous_period)
Delegates to the Metric Period.
-
#totals ⇒ Nucleo::Models::MetricPeriodsTotals
Delegates to the Totals.
Methods inherited from Base
#<=>, #analytics_category?, #category, #children, #children?, #context, #executed_at, #id, #initialize, #page, #page?, #page_context?, #page_recommendation_id, #record_id, #seo_category?, #site_analytic_id, #site_context?, #site_id, #status, #type
Constructor Details
This class inherits a constructor from Nucleo::Models::FeedTypes::Base
Instance Method Details
#any? ⇒ Boolean
44 45 46 |
# File 'lib/nucleo/models/feed_types/analytics/site/pages.rb', line 44 def any? self.current_period.rows? end |
#current_period ⇒ Nucleo::Models::MetricPeriod
Delegates to the Metric Period
40 41 42 |
# File 'lib/nucleo/models/feed_types/analytics/site/pages.rb', line 40 def current_period self.metric.metric_periods.current_period end |
#metric ⇒ Nucleo::Models::Metric
Returns the specific Metric for this page
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/nucleo/models/feed_types/analytics/site/pages.rb', line 17 def metric params = { 'metric' => METRIC_NAME, 'dimension' => DIMENSION_NAME, 'classification' => @attributes['classification'], 'totals' => data.fetch('totals', {}), 'current_period' => data.fetch('current_period', {}), 'prior_period' => data.fetch('prior_period', {}) } Nucleo::Models::Metric.new(params) end |
#prior_period ⇒ Nucleo::Models::MetricPeriod Also known as: previous_period
Delegates to the Metric Period
51 52 53 |
# File 'lib/nucleo/models/feed_types/analytics/site/pages.rb', line 51 def prior_period self.metric.metric_periods.prior_period end |
#totals ⇒ Nucleo::Models::MetricPeriodsTotals
Delegates to the Totals
33 34 35 |
# File 'lib/nucleo/models/feed_types/analytics/site/pages.rb', line 33 def totals self.metric.metric_periods.totals end |