Class: WhatsappSdk::Resource::TemplateAnalytic

Inherits:
Object
  • Object
show all
Defined in:
lib/whatsapp_sdk/resource/template_analytic.rb

Defined Under Namespace

Modules: Granularity, MetricType

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(granularity:, product_type:, data_points:) ⇒ TemplateAnalytic

Returns a new instance of TemplateAnalytic.



39
40
41
42
43
# File 'lib/whatsapp_sdk/resource/template_analytic.rb', line 39

def initialize(granularity:, product_type:, data_points:)
  @granularity = granularity
  @product_type = product_type
  @data_points = data_points
end

Instance Attribute Details

#data_pointsObject

Returns the value of attribute data_points.



37
38
39
# File 'lib/whatsapp_sdk/resource/template_analytic.rb', line 37

def data_points
  @data_points
end

#granularityObject

Returns the value of attribute granularity.



37
38
39
# File 'lib/whatsapp_sdk/resource/template_analytic.rb', line 37

def granularity
  @granularity
end

#product_typeObject

Returns the value of attribute product_type.



37
38
39
# File 'lib/whatsapp_sdk/resource/template_analytic.rb', line 37

def product_type
  @product_type
end

Class Method Details

.from_hash(hash) ⇒ Object



45
46
47
48
49
50
51
# File 'lib/whatsapp_sdk/resource/template_analytic.rb', line 45

def self.from_hash(hash)
  new(
    granularity: hash["granularity"],
    product_type: hash["product_type"],
    data_points: hash["data_points"]
  )
end