Class: CommandTower::Messaging::Preferences::CatalogNotificationResult

Inherits:
Data
  • Object
show all
Defined in:
app/services/command_tower/messaging/preferences/catalog_notification_result.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#allowed_channelsObject (readonly)

Returns the value of attribute allowed_channels

Returns:

  • (Object)

    the current value of 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_channelsObject (readonly)

Returns the value of attribute available_channels

Returns:

  • (Object)

    the current value of available_channels



6
7
8
# File 'app/services/command_tower/messaging/preferences/catalog_notification_result.rb', line 6

def available_channels
  @available_channels
end

#channelsObject (readonly)

Returns the value of attribute channels

Returns:

  • (Object)

    the current value of channels



6
7
8
# File 'app/services/command_tower/messaging/preferences/catalog_notification_result.rb', line 6

def channels
  @channels
end

#configurableObject (readonly)

Returns the value of attribute configurable

Returns:

  • (Object)

    the current value of configurable



6
7
8
# File 'app/services/command_tower/messaging/preferences/catalog_notification_result.rb', line 6

def configurable
  @configurable
end

#descriptionObject (readonly)

Returns the value of attribute description

Returns:

  • (Object)

    the current value of description



6
7
8
# File 'app/services/command_tower/messaging/preferences/catalog_notification_result.rb', line 6

def description
  @description
end

#inbox_availableObject (readonly)

Returns the value of attribute inbox_available

Returns:

  • (Object)

    the current value of 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_enabledObject (readonly)

Returns the value of attribute inbox_enabled

Returns:

  • (Object)

    the current value of inbox_enabled



6
7
8
# File 'app/services/command_tower/messaging/preferences/catalog_notification_result.rb', line 6

def inbox_enabled
  @inbox_enabled
end

#keyObject (readonly)

Returns the value of attribute key

Returns:

  • (Object)

    the current value of key



6
7
8
# File 'app/services/command_tower/messaging/preferences/catalog_notification_result.rb', line 6

def key
  @key
end

#labelObject (readonly)

Returns the value of attribute label

Returns:

  • (Object)

    the current value of label



6
7
8
# File 'app/services/command_tower/messaging/preferences/catalog_notification_result.rb', line 6

def label
  @label
end

#mandatoryObject (readonly)

Returns the value of attribute mandatory

Returns:

  • (Object)

    the current value of mandatory



6
7
8
# File 'app/services/command_tower/messaging/preferences/catalog_notification_result.rb', line 6

def mandatory
  @mandatory
end

#orderObject (readonly)

Returns the value of attribute order

Returns:

  • (Object)

    the current value of order



6
7
8
# File 'app/services/command_tower/messaging/preferences/catalog_notification_result.rb', line 6

def order
  @order
end

#stored_override_presentObject (readonly)

Returns the value of attribute stored_override_present

Returns:

  • (Object)

    the current value of 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