Class: CommandTower::Messaging::NotificationTypes::Declaration

Inherits:
Data
  • Object
show all
Defined in:
app/services/command_tower/messaging/notification_types/declaration.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/notification_types/declaration.rb', line 6

def allowed_channels
  @allowed_channels
end

#category_keyObject (readonly)

Returns the value of attribute category_key

Returns:

  • (Object)

    the current value of category_key



6
7
8
# File 'app/services/command_tower/messaging/notification_types/declaration.rb', line 6

def category_key
  @category_key
end

#category_labelObject (readonly)

Returns the value of attribute category_label

Returns:

  • (Object)

    the current value of category_label



6
7
8
# File 'app/services/command_tower/messaging/notification_types/declaration.rb', line 6

def category_label
  @category_label
end

#category_orderObject (readonly)

Returns the value of attribute category_order

Returns:

  • (Object)

    the current value of category_order



6
7
8
# File 'app/services/command_tower/messaging/notification_types/declaration.rb', line 6

def category_order
  @category_order
end

#default_channelsObject (readonly)

Returns the value of attribute default_channels

Returns:

  • (Object)

    the current value of default_channels



6
7
8
# File 'app/services/command_tower/messaging/notification_types/declaration.rb', line 6

def default_channels
  @default_channels
end

#default_preference_stateObject (readonly)

Returns the value of attribute default_preference_state

Returns:

  • (Object)

    the current value of default_preference_state



6
7
8
# File 'app/services/command_tower/messaging/notification_types/declaration.rb', line 6

def default_preference_state
  @default_preference_state
end

#delivery_status_visibleObject (readonly)

Returns the value of attribute delivery_status_visible

Returns:

  • (Object)

    the current value of delivery_status_visible



6
7
8
# File 'app/services/command_tower/messaging/notification_types/declaration.rb', line 6

def delivery_status_visible
  @delivery_status_visible
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/notification_types/declaration.rb', line 6

def description
  @description
end

#host_ownershipObject (readonly)

Returns the value of attribute host_ownership

Returns:

  • (Object)

    the current value of host_ownership



6
7
8
# File 'app/services/command_tower/messaging/notification_types/declaration.rb', line 6

def host_ownership
  @host_ownership
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/notification_types/declaration.rb', line 6

def inbox_available
  @inbox_available
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/notification_types/declaration.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/notification_types/declaration.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/notification_types/declaration.rb', line 6

def mandatory
  @mandatory
end

#priorityObject (readonly)

Returns the value of attribute priority

Returns:

  • (Object)

    the current value of priority



6
7
8
# File 'app/services/command_tower/messaging/notification_types/declaration.rb', line 6

def priority
  @priority
end

#retentionObject (readonly)

Returns the value of attribute retention

Returns:

  • (Object)

    the current value of retention



6
7
8
# File 'app/services/command_tower/messaging/notification_types/declaration.rb', line 6

def retention
  @retention
end

#settings_visibleObject (readonly)

Returns the value of attribute settings_visible

Returns:

  • (Object)

    the current value of settings_visible



6
7
8
# File 'app/services/command_tower/messaging/notification_types/declaration.rb', line 6

def settings_visible
  @settings_visible
end

#type_orderObject (readonly)

Returns the value of attribute type_order

Returns:

  • (Object)

    the current value of type_order



6
7
8
# File 'app/services/command_tower/messaging/notification_types/declaration.rb', line 6

def type_order
  @type_order
end

#user_configurableObject (readonly)

Returns the value of attribute user_configurable

Returns:

  • (Object)

    the current value of user_configurable



6
7
8
# File 'app/services/command_tower/messaging/notification_types/declaration.rb', line 6

def user_configurable
  @user_configurable
end

Class Method Details

.build(key:, allowed_channels:, default_channels:, inbox_available:, user_configurable:, mandatory:, default_preference_state:, label:, category_key:, category_label:, category_order:, type_order:, settings_visible: true, description: nil, priority: nil, retention: nil, delivery_status_visible: nil, host_ownership: nil) ⇒ Object



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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'app/services/command_tower/messaging/notification_types/declaration.rb', line 26

def self.build(
  key:,
  allowed_channels:,
  default_channels:,
  inbox_available:,
  user_configurable:,
  mandatory:,
  default_preference_state:,
  label:,
  category_key:,
  category_label:,
  category_order:,
  type_order:,
  settings_visible: true,
  description: nil,
  priority: nil,
  retention: nil,
  delivery_status_visible: nil,
  host_ownership: nil
)
  new(
    key: key.nil? ? nil : key.to_s,
    allowed_channels: freeze_channel_list(allowed_channels),
    default_channels: freeze_channel_list(default_channels),
    inbox_available: !!inbox_available,
    user_configurable: !!user_configurable,
    mandatory: !!mandatory,
    default_preference_state: freeze_preference_state(default_preference_state),
    label: label.nil? ? nil : label.to_s,
    category_key: category_key.nil? ? nil : category_key.to_s,
    category_label: category_label.nil? ? nil : category_label.to_s,
    category_order:,
    type_order:,
    settings_visible: !!settings_visible,
    description:,
    priority:,
    retention:,
    delivery_status_visible:,
    host_ownership:,
  ).freeze
end