Class: CommandTower::Messaging::Preferences::EvaluationResult

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#effective_preference_stateObject (readonly)

Returns the value of attribute effective_preference_state

Returns:

  • (Object)

    the current value of effective_preference_state



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

def effective_preference_state
  @effective_preference_state
end

#inbox_permittedObject (readonly)

Returns the value of attribute inbox_permitted

Returns:

  • (Object)

    the current value of inbox_permitted



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

def inbox_permitted
  @inbox_permitted
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/evaluation_result.rb', line 6

def mandatory
  @mandatory
end

#mandatory_enforcedObject (readonly)

Returns the value of attribute mandatory_enforced

Returns:

  • (Object)

    the current value of mandatory_enforced



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

def mandatory_enforced
  @mandatory_enforced
end

#notification_type_keyObject (readonly)

Returns the value of attribute notification_type_key

Returns:

  • (Object)

    the current value of notification_type_key



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

def notification_type_key
  @notification_type_key
end

#permitted_channelsObject (readonly)

Returns the value of attribute permitted_channels

Returns:

  • (Object)

    the current value of permitted_channels



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

def permitted_channels
  @permitted_channels
end

#recipient_idObject (readonly)

Returns the value of attribute recipient_id

Returns:

  • (Object)

    the current value of recipient_id



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

def recipient_id
  @recipient_id
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/evaluation_result.rb', line 6

def stored_override_present
  @stored_override_present
end

#suppressed_destinationsObject (readonly)

Returns the value of attribute suppressed_destinations

Returns:

  • (Object)

    the current value of suppressed_destinations



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

def suppressed_destinations
  @suppressed_destinations
end

Class Method Details

.build(notification_type_key:, recipient_id:, permitted_channels:, inbox_permitted:, suppressed_destinations:, mandatory:, mandatory_enforced:, stored_override_present: false, effective_preference_state: nil) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'app/services/command_tower/messaging/preferences/evaluation_result.rb', line 17

def self.build(
  notification_type_key:,
  recipient_id:,
  permitted_channels:,
  inbox_permitted:,
  suppressed_destinations:,
  mandatory:,
  mandatory_enforced:,
  stored_override_present: false,
  effective_preference_state: nil
)
  new(
    notification_type_key: notification_type_key.to_s,
    recipient_id:,
    permitted_channels: Array(permitted_channels).map(&:to_s).freeze,
    inbox_permitted: !!inbox_permitted,
    suppressed_destinations: Array(suppressed_destinations).freeze,
    mandatory: !!mandatory,
    mandatory_enforced: !!mandatory_enforced,
    stored_override_present: !!stored_override_present,
    effective_preference_state: freeze_effective_state(effective_preference_state),
  ).freeze
end