Class: CommandTower::Messaging::Planner::DestinationPlan
- Inherits:
-
Data
- Object
- Data
- CommandTower::Messaging::Planner::DestinationPlan
- Defined in:
- app/services/command_tower/messaging/planner/destination_plan.rb
Instance Attribute Summary collapse
-
#excluded_destinations ⇒ Object
readonly
Returns the value of attribute excluded_destinations.
-
#inbox_selected ⇒ Object
readonly
Returns the value of attribute inbox_selected.
-
#mandatory ⇒ Object
readonly
Returns the value of attribute mandatory.
-
#notification_type_key ⇒ Object
readonly
Returns the value of attribute notification_type_key.
-
#preference_evaluation ⇒ Object
readonly
Returns the value of attribute preference_evaluation.
-
#recipient_id ⇒ Object
readonly
Returns the value of attribute recipient_id.
-
#selected_channels ⇒ Object
readonly
Returns the value of attribute selected_channels.
Class Method Summary collapse
Instance Attribute Details
#excluded_destinations ⇒ Object (readonly)
Returns the value of attribute excluded_destinations
6 7 8 |
# File 'app/services/command_tower/messaging/planner/destination_plan.rb', line 6 def excluded_destinations @excluded_destinations end |
#inbox_selected ⇒ Object (readonly)
Returns the value of attribute inbox_selected
6 7 8 |
# File 'app/services/command_tower/messaging/planner/destination_plan.rb', line 6 def inbox_selected @inbox_selected end |
#mandatory ⇒ Object (readonly)
Returns the value of attribute mandatory
6 7 8 |
# File 'app/services/command_tower/messaging/planner/destination_plan.rb', line 6 def mandatory @mandatory end |
#notification_type_key ⇒ Object (readonly)
Returns the value of attribute notification_type_key
6 7 8 |
# File 'app/services/command_tower/messaging/planner/destination_plan.rb', line 6 def notification_type_key @notification_type_key end |
#preference_evaluation ⇒ Object (readonly)
Returns the value of attribute preference_evaluation
6 7 8 |
# File 'app/services/command_tower/messaging/planner/destination_plan.rb', line 6 def preference_evaluation @preference_evaluation end |
#recipient_id ⇒ Object (readonly)
Returns the value of attribute recipient_id
6 7 8 |
# File 'app/services/command_tower/messaging/planner/destination_plan.rb', line 6 def recipient_id @recipient_id end |
#selected_channels ⇒ Object (readonly)
Returns the value of attribute selected_channels
6 7 8 |
# File 'app/services/command_tower/messaging/planner/destination_plan.rb', line 6 def selected_channels @selected_channels end |
Class Method Details
.build(notification_type_key:, recipient_id:, selected_channels:, inbox_selected:, excluded_destinations:, mandatory:, preference_evaluation:) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'app/services/command_tower/messaging/planner/destination_plan.rb', line 15 def self.build( notification_type_key:, recipient_id:, selected_channels:, inbox_selected:, excluded_destinations:, mandatory:, preference_evaluation: ) unless preference_evaluation.is_a?(Preferences::EvaluationResult) raise InvalidEvaluationError, "preference_evaluation must be a Preferences::EvaluationResult" end new( notification_type_key: notification_type_key.to_s, recipient_id:, selected_channels: Array(selected_channels).map(&:to_s).freeze, inbox_selected: !!inbox_selected, excluded_destinations: Array(excluded_destinations).freeze, mandatory: !!mandatory, preference_evaluation:, ).freeze end |