Class: Courier::Models::JourneyExperimentVariant
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- Courier::Models::JourneyExperimentVariant
- Defined in:
- lib/courier/models/journey_experiment_variant.rb,
sig/courier/models/journey_experiment_variant.rbs
Instance Attribute Summary collapse
- #id ⇒ String
-
#name ⇒ String?
Optional display name for the variant.
-
#template_id ⇒ String
The notification template sent for this variant.
-
#weight ⇒ Float
Relative routing weight.
Instance Method Summary collapse
-
#initialize(id:, template_id:, weight:, name: nil) ⇒ Object
constructor
A single weighted variant of an experiment.
- #to_hash ⇒ {
Methods inherited from Internal::Type::BaseModel
==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml
Methods included from Internal::Type::Converter
#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info
Methods included from Internal::Util::SorbetRuntimeSupport
#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type
Constructor Details
#initialize(id:, template_id:, weight:, name: nil) ⇒ Object
A single weighted variant of an experiment. Variant ids must be unique within the experiment and the sum of all variant weights must be greater than 0. Weights are relative (no sum-to-100 requirement) — routing normalizes them proportionally.
|
|
# File 'lib/courier/models/journey_experiment_variant.rb', line 29
|
Instance Attribute Details
#id ⇒ String
9 |
# File 'lib/courier/models/journey_experiment_variant.rb', line 9 required :id, String |
#name ⇒ String?
Optional display name for the variant.
27 |
# File 'lib/courier/models/journey_experiment_variant.rb', line 27 optional :name, String |
#template_id ⇒ String
The notification template sent for this variant.
15 |
# File 'lib/courier/models/journey_experiment_variant.rb', line 15 required :template_id, String, api_name: :templateId |
#weight ⇒ Float
Relative routing weight. Must be non-negative.
21 |
# File 'lib/courier/models/journey_experiment_variant.rb', line 21 required :weight, Float |
Instance Method Details
#to_hash ⇒ {
24 |
# File 'sig/courier/models/journey_experiment_variant.rbs', line 24
def to_hash: -> {
|