Class: CommandTower::Messaging::Preferences::CatalogNotificationResult
- Inherits:
-
Data
- Object
- Data
- CommandTower::Messaging::Preferences::CatalogNotificationResult
- Defined in:
- app/services/command_tower/messaging/preferences/catalog_notification_result.rb
Instance Attribute Summary collapse
-
#allowed_channels ⇒ Object
readonly
Returns the value of attribute allowed_channels.
-
#available_channels ⇒ Object
readonly
Returns the value of attribute available_channels.
-
#channels ⇒ Object
readonly
Returns the value of attribute channels.
-
#configurable ⇒ Object
readonly
Returns the value of attribute configurable.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#inbox_available ⇒ Object
readonly
Returns the value of attribute inbox_available.
-
#inbox_enabled ⇒ Object
readonly
Returns the value of attribute inbox_enabled.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#mandatory ⇒ Object
readonly
Returns the value of attribute mandatory.
-
#order ⇒ Object
readonly
Returns the value of attribute order.
-
#stored_override_present ⇒ Object
readonly
Returns the value of attribute stored_override_present.
Class Method Summary collapse
Instance Attribute Details
#allowed_channels ⇒ Object (readonly)
Returns the value of attribute allowed_channels
6 7 8 |
# File 'app/services/command_tower/messaging/preferences/catalog_notification_result.rb', line 6 def allowed_channels @allowed_channels end |
#available_channels ⇒ Object (readonly)
Returns the value of attribute available_channels
6 7 8 |
# File 'app/services/command_tower/messaging/preferences/catalog_notification_result.rb', line 6 def available_channels @available_channels end |
#channels ⇒ Object (readonly)
Returns the value of attribute channels
6 7 8 |
# File 'app/services/command_tower/messaging/preferences/catalog_notification_result.rb', line 6 def channels @channels end |
#configurable ⇒ Object (readonly)
Returns the value of attribute configurable
6 7 8 |
# File 'app/services/command_tower/messaging/preferences/catalog_notification_result.rb', line 6 def configurable @configurable end |
#description ⇒ Object (readonly)
Returns the value of attribute description
6 7 8 |
# File 'app/services/command_tower/messaging/preferences/catalog_notification_result.rb', line 6 def description @description end |
#inbox_available ⇒ Object (readonly)
Returns the value of attribute inbox_available
6 7 8 |
# File 'app/services/command_tower/messaging/preferences/catalog_notification_result.rb', line 6 def inbox_available @inbox_available end |
#inbox_enabled ⇒ Object (readonly)
Returns the value of attribute inbox_enabled
6 7 8 |
# File 'app/services/command_tower/messaging/preferences/catalog_notification_result.rb', line 6 def inbox_enabled @inbox_enabled end |
#key ⇒ Object (readonly)
Returns the value of attribute key
6 7 8 |
# File 'app/services/command_tower/messaging/preferences/catalog_notification_result.rb', line 6 def key @key end |
#label ⇒ Object (readonly)
Returns the value of attribute label
6 7 8 |
# File 'app/services/command_tower/messaging/preferences/catalog_notification_result.rb', line 6 def label @label end |
#mandatory ⇒ Object (readonly)
Returns the value of attribute mandatory
6 7 8 |
# File 'app/services/command_tower/messaging/preferences/catalog_notification_result.rb', line 6 def mandatory @mandatory end |
#order ⇒ Object (readonly)
Returns the value of attribute order
6 7 8 |
# File 'app/services/command_tower/messaging/preferences/catalog_notification_result.rb', line 6 def order @order end |
#stored_override_present ⇒ Object (readonly)
Returns the value of attribute stored_override_present
6 7 8 |
# File 'app/services/command_tower/messaging/preferences/catalog_notification_result.rb', line 6 def stored_override_present @stored_override_present end |
Class Method Details
.build(key:, label:, description:, order:, configurable:, mandatory:, inbox_available:, allowed_channels:, available_channels:, inbox_enabled:, channels:, stored_override_present:) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'app/services/command_tower/messaging/preferences/catalog_notification_result.rb', line 20 def self.build( key:, label:, description:, order:, configurable:, mandatory:, inbox_available:, allowed_channels:, available_channels:, inbox_enabled:, channels:, stored_override_present: ) frozen_channels = channels.to_h.transform_keys(&:to_s).transform_values { |value| !!value }.freeze new( key: key.to_s, label: label.to_s, description:, order: Integer(order), configurable: !!configurable, mandatory: !!mandatory, inbox_available: !!inbox_available, allowed_channels: Array(allowed_channels).map(&:to_s).freeze, available_channels: Array(available_channels).map(&:to_s).freeze, inbox_enabled: !!inbox_enabled, channels: frozen_channels, stored_override_present: !!stored_override_present, ).freeze end |