Class: VariableModel

Inherits:
Object
  • Object
show all
Defined in:
lib/wingify/models/campaign/variable_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

#initializeVariableModel

Returns a new instance of VariableModel.



19
20
21
22
23
24
# File 'lib/wingify/models/campaign/variable_model.rb', line 19

def initialize
  @value = nil
  @type = ''
  @key = ''
  @id = nil
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



17
18
19
# File 'lib/wingify/models/campaign/variable_model.rb', line 17

def id
  @id
end

#keyObject

Returns the value of attribute key.



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

def key
  @key
end

#typeObject

Returns the value of attribute type.



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

def type
  @type
end

#valueObject

Returns the value of attribute value.



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

def value
  @value
end

Instance Method Details

#get_idObject



47
48
49
# File 'lib/wingify/models/campaign/variable_model.rb', line 47

def get_id
    @id
end

#get_keyObject



43
44
45
# File 'lib/wingify/models/campaign/variable_model.rb', line 43

def get_key
    @key
end

#get_typeObject



39
40
41
# File 'lib/wingify/models/campaign/variable_model.rb', line 39

def get_type
    @type
end

#get_valueObject



35
36
37
# File 'lib/wingify/models/campaign/variable_model.rb', line 35

def get_value
    @value
end

#model_from_dictionary(variable) ⇒ Object

Creates a model instance from a hash (dictionary)



27
28
29
30
31
32
33
# File 'lib/wingify/models/campaign/variable_model.rb', line 27

def model_from_dictionary(variable)
  @value = variable["value"]
  @type = variable["type"]
  @key = variable["key"]
  @id = variable["id"]
  self
end