Class: AnalyticsReportField

Inherits:
Object
  • Object
show all
Extended by:
ActiveSupport::Concern
Includes:
ActiveModel::Conversion, ActiveModel::Model, ActiveModel::Validations
Defined in:
lib/analytics_report_field.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ AnalyticsReportField

Returns a new instance of AnalyticsReportField.



16
17
18
19
20
21
22
# File 'lib/analytics_report_field.rb', line 16

def initialize(params={})
  params.each do |attr, value|
    self.public_send("#{attr}=", value)
  end if params

  super()
end

Instance Attribute Details

#is_aggregateObject

Returns the value of attribute is_aggregate.



25
26
27
# File 'lib/analytics_report_field.rb', line 25

def is_aggregate
  @is_aggregate
end

#nameObject

Returns the value of attribute name.



25
26
27
# File 'lib/analytics_report_field.rb', line 25

def name
  @name
end

#valueObject

Returns the value of attribute value.



25
26
27
# File 'lib/analytics_report_field.rb', line 25

def value
  @value
end

Instance Method Details

#avgObject



35
36
37
# File 'lib/analytics_report_field.rb', line 35

def avg
  @value['avg'].present? ? @value['avg'] : 0
end

#stddevObject



39
40
41
# File 'lib/analytics_report_field.rb', line 39

def stddev
  @value['stddev'].present? ? @value['stddev'] : 0
end

#sumObject



31
32
33
# File 'lib/analytics_report_field.rb', line 31

def sum
  @value['sum'].present? ? @value['sum'] : 0
end

#to_sObject



27
28
29
# File 'lib/analytics_report_field.rb', line 27

def to_s
  @value.to_s
end