Class: RuleModel
- Inherits:
-
Object
- Object
- RuleModel
- Defined in:
- lib/wingify/models/campaign/rule_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
-
#campaign_id ⇒ Object
readonly
Returns the value of attribute campaign_id.
-
#rule_key ⇒ Object
readonly
Returns the value of attribute rule_key.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#variation_id ⇒ Object
readonly
Returns the value of attribute variation_id.
Instance Method Summary collapse
- #get_campaign_id ⇒ Object
- #get_rule_key ⇒ Object
- #get_status ⇒ Object
- #get_type ⇒ Object
- #get_variation_id ⇒ Object
-
#initialize ⇒ RuleModel
constructor
A new instance of RuleModel.
-
#model_from_dictionary(rule) ⇒ Object
Creates a model instance from a hash (dictionary).
Constructor Details
#initialize ⇒ RuleModel
Returns a new instance of RuleModel.
18 19 20 21 22 23 24 |
# File 'lib/wingify/models/campaign/rule_model.rb', line 18 def initialize @status = false @variation_id = nil @campaign_id = nil @type = '' @rule_key = '' end |
Instance Attribute Details
#campaign_id ⇒ Object (readonly)
Returns the value of attribute campaign_id.
16 17 18 |
# File 'lib/wingify/models/campaign/rule_model.rb', line 16 def campaign_id @campaign_id end |
#rule_key ⇒ Object (readonly)
Returns the value of attribute rule_key.
16 17 18 |
# File 'lib/wingify/models/campaign/rule_model.rb', line 16 def rule_key @rule_key end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
16 17 18 |
# File 'lib/wingify/models/campaign/rule_model.rb', line 16 def status @status end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
16 17 18 |
# File 'lib/wingify/models/campaign/rule_model.rb', line 16 def type @type end |
#variation_id ⇒ Object (readonly)
Returns the value of attribute variation_id.
16 17 18 |
# File 'lib/wingify/models/campaign/rule_model.rb', line 16 def variation_id @variation_id end |
Instance Method Details
#get_campaign_id ⇒ Object
48 49 50 |
# File 'lib/wingify/models/campaign/rule_model.rb', line 48 def get_campaign_id @campaign_id end |
#get_rule_key ⇒ Object
52 53 54 |
# File 'lib/wingify/models/campaign/rule_model.rb', line 52 def get_rule_key @rule_key end |
#get_status ⇒ Object
40 41 42 |
# File 'lib/wingify/models/campaign/rule_model.rb', line 40 def get_status @status end |
#get_type ⇒ Object
36 37 38 |
# File 'lib/wingify/models/campaign/rule_model.rb', line 36 def get_type @type end |
#get_variation_id ⇒ Object
44 45 46 |
# File 'lib/wingify/models/campaign/rule_model.rb', line 44 def get_variation_id @variation_id end |
#model_from_dictionary(rule) ⇒ Object
Creates a model instance from a hash (dictionary)
27 28 29 30 31 32 33 34 |
# File 'lib/wingify/models/campaign/rule_model.rb', line 27 def model_from_dictionary(rule) @type = rule["type"] @status = rule["status"] @variation_id = rule["variationId"] @campaign_id = rule["campaignId"] @rule_key = rule["ruleKey"] self end |