Class: Nucleo::Models::PageMetric
- Inherits:
-
Object
- Object
- Nucleo::Models::PageMetric
- Defined in:
- lib/nucleo/models/page_metric.rb
Constant Summary collapse
- METRIC_NAME =
'ga:pageviews'.freeze
Instance Method Summary collapse
-
#change ⇒ Integer
Returns the change.
-
#initialize(attributes = {}) ⇒ Nucleo::Models::PageRank
constructor
Returns an instance of the PageRank domain model.
-
#pct_total ⇒ Integer
Returns the pct total.
-
#rank ⇒ Integer
Returns the rank.
-
#rank_change ⇒ Integer
Returns the rank.
-
#value ⇒ Integer
Returns the metric value.
Constructor Details
#initialize(attributes = {}) ⇒ Nucleo::Models::PageRank
Returns an instance of the PageRank domain model
11 12 13 |
# File 'lib/nucleo/models/page_metric.rb', line 11 def initialize(attributes={}) @attributes = attributes end |
Instance Method Details
#change ⇒ Integer
Returns the change
25 26 27 |
# File 'lib/nucleo/models/page_metric.rb', line 25 def change @attributes[translated_key_name(:change)].to_f end |
#pct_total ⇒ Integer
Returns the pct total
32 33 34 |
# File 'lib/nucleo/models/page_metric.rb', line 32 def pct_total @attributes[translated_key_name(:pct_total)].to_f end |
#rank ⇒ Integer
Returns the rank
39 40 41 |
# File 'lib/nucleo/models/page_metric.rb', line 39 def rank @attributes[translated_key_name(:rank)].to_i end |
#rank_change ⇒ Integer
Returns the rank
46 47 48 |
# File 'lib/nucleo/models/page_metric.rb', line 46 def rank_change @attributes[translated_key_name(:rank_change)].to_i end |
#value ⇒ Integer
Returns the metric value
18 19 20 |
# File 'lib/nucleo/models/page_metric.rb', line 18 def value @attributes[METRIC_NAME].to_i end |