Class: CommandTower::Messaging::Preferences::SuppressedDestination
- Inherits:
-
Data
- Object
- Data
- CommandTower::Messaging::Preferences::SuppressedDestination
- Defined in:
- app/services/command_tower/messaging/preferences/suppressed_destination.rb
Instance Attribute Summary collapse
-
#destination ⇒ Object
readonly
Returns the value of attribute destination.
-
#reason_class ⇒ Object
readonly
Returns the value of attribute reason_class.
Class Method Summary collapse
Instance Attribute Details
#destination ⇒ Object (readonly)
Returns the value of attribute destination
6 7 8 |
# File 'app/services/command_tower/messaging/preferences/suppressed_destination.rb', line 6 def destination @destination end |
#reason_class ⇒ Object (readonly)
Returns the value of attribute reason_class
6 7 8 |
# File 'app/services/command_tower/messaging/preferences/suppressed_destination.rb', line 6 def reason_class @reason_class end |
Class Method Details
.build(destination:, reason_class:) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/services/command_tower/messaging/preferences/suppressed_destination.rb', line 7 def self.build(destination:, reason_class:) unless ReasonClasses::ALL.include?(reason_class) raise ArgumentError, "unknown reason_class: #{reason_class}" end dest = if destination == :inbox || destination == "inbox" :inbox else destination.to_s end new(destination: dest, reason_class:).freeze end |