Class: VariableModel
- Inherits:
-
Object
- Object
- VariableModel
- 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
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#key ⇒ Object
Returns the value of attribute key.
-
#type ⇒ Object
Returns the value of attribute type.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #get_id ⇒ Object
- #get_key ⇒ Object
- #get_type ⇒ Object
- #get_value ⇒ Object
-
#initialize ⇒ VariableModel
constructor
A new instance of VariableModel.
-
#model_from_dictionary(variable) ⇒ Object
Creates a model instance from a hash (dictionary).
Constructor Details
#initialize ⇒ VariableModel
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
#id ⇒ Object (readonly)
Returns the value of attribute id.
17 18 19 |
# File 'lib/wingify/models/campaign/variable_model.rb', line 17 def id @id end |
#key ⇒ Object
Returns the value of attribute key.
16 17 18 |
# File 'lib/wingify/models/campaign/variable_model.rb', line 16 def key @key end |
#type ⇒ Object
Returns the value of attribute type.
16 17 18 |
# File 'lib/wingify/models/campaign/variable_model.rb', line 16 def type @type end |
#value ⇒ Object
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_id ⇒ Object
47 48 49 |
# File 'lib/wingify/models/campaign/variable_model.rb', line 47 def get_id @id end |
#get_key ⇒ Object
43 44 45 |
# File 'lib/wingify/models/campaign/variable_model.rb', line 43 def get_key @key end |
#get_type ⇒ Object
39 40 41 |
# File 'lib/wingify/models/campaign/variable_model.rb', line 39 def get_type @type end |
#get_value ⇒ Object
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 |