Class: MetricModel

Inherits:
Object
  • Object
show all
Defined in:
lib/wingify/models/campaign/metric_model.rb

Overview

Copyright 2024-2026 Wingify Software Pvt. Ltd.

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMetricModel

Returns a new instance of MetricModel.



18
19
20
21
22
# File 'lib/wingify/models/campaign/metric_model.rb', line 18

def initialize
  @id = nil
  @identifier = ''
  @type = ''
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



16
17
18
# File 'lib/wingify/models/campaign/metric_model.rb', line 16

def id
  @id
end

#identifierObject (readonly)

Returns the value of attribute identifier.



16
17
18
# File 'lib/wingify/models/campaign/metric_model.rb', line 16

def identifier
  @identifier
end

#typeObject (readonly)

Returns the value of attribute type.



16
17
18
# File 'lib/wingify/models/campaign/metric_model.rb', line 16

def type
  @type
end

Instance Method Details

#get_idObject



32
33
34
# File 'lib/wingify/models/campaign/metric_model.rb', line 32

def get_id
    @id
end

#get_identifierObject



36
37
38
# File 'lib/wingify/models/campaign/metric_model.rb', line 36

def get_identifier
    @identifier
end

#get_typeObject



40
41
42
# File 'lib/wingify/models/campaign/metric_model.rb', line 40

def get_type
    @type
end

#model_from_dictionary(metric) ⇒ Object

Creates a model instance from a hash (dictionary)



25
26
27
28
29
30
# File 'lib/wingify/models/campaign/metric_model.rb', line 25

def model_from_dictionary(metric)
  @identifier = metric["identifier"]
  @id = metric["id"]
  @type = metric["type"]
  self
end