Class: MetricModel
- Inherits:
-
Object
- Object
- MetricModel
- 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
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#identifier ⇒ Object
readonly
Returns the value of attribute identifier.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #get_id ⇒ Object
- #get_identifier ⇒ Object
- #get_type ⇒ Object
-
#initialize ⇒ MetricModel
constructor
A new instance of MetricModel.
-
#model_from_dictionary(metric) ⇒ Object
Creates a model instance from a hash (dictionary).
Constructor Details
#initialize ⇒ MetricModel
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
#id ⇒ Object (readonly)
Returns the value of attribute id.
16 17 18 |
# File 'lib/wingify/models/campaign/metric_model.rb', line 16 def id @id end |
#identifier ⇒ Object (readonly)
Returns the value of attribute identifier.
16 17 18 |
# File 'lib/wingify/models/campaign/metric_model.rb', line 16 def identifier @identifier end |
#type ⇒ Object (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_id ⇒ Object
32 33 34 |
# File 'lib/wingify/models/campaign/metric_model.rb', line 32 def get_id @id end |
#get_identifier ⇒ Object
36 37 38 |
# File 'lib/wingify/models/campaign/metric_model.rb', line 36 def get_identifier @identifier end |
#get_type ⇒ Object
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 |