Class: CommandTower::Messaging::RecipientReadiness::ChannelResult

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#channel_keyObject (readonly)

Returns the value of attribute channel_key

Returns:

  • (Object)

    the current value of channel_key



6
7
8
# File 'app/services/command_tower/messaging/recipient_readiness/channel_result.rb', line 6

def channel_key
  @channel_key
end

#eligible_endpoint_countObject (readonly)

Returns the value of attribute eligible_endpoint_count

Returns:

  • (Object)

    the current value of eligible_endpoint_count



6
7
8
# File 'app/services/command_tower/messaging/recipient_readiness/channel_result.rb', line 6

def eligible_endpoint_count
  @eligible_endpoint_count
end

#eligible_endpoint_idsObject (readonly)

Returns the value of attribute eligible_endpoint_ids

Returns:

  • (Object)

    the current value of eligible_endpoint_ids



6
7
8
# File 'app/services/command_tower/messaging/recipient_readiness/channel_result.rb', line 6

def eligible_endpoint_ids
  @eligible_endpoint_ids
end

#endpoint_countObject (readonly)

Returns the value of attribute endpoint_count

Returns:

  • (Object)

    the current value of endpoint_count



6
7
8
# File 'app/services/command_tower/messaging/recipient_readiness/channel_result.rb', line 6

def endpoint_count
  @endpoint_count
end

#evaluated_atObject (readonly)

Returns the value of attribute evaluated_at

Returns:

  • (Object)

    the current value of evaluated_at



6
7
8
# File 'app/services/command_tower/messaging/recipient_readiness/channel_result.rb', line 6

def evaluated_at
  @evaluated_at
end

#platform_configuredObject (readonly)

Returns the value of attribute platform_configured

Returns:

  • (Object)

    the current value of platform_configured



6
7
8
# File 'app/services/command_tower/messaging/recipient_readiness/channel_result.rb', line 6

def platform_configured
  @platform_configured
end

#platform_enabledObject (readonly)

Returns the value of attribute platform_enabled

Returns:

  • (Object)

    the current value of platform_enabled



6
7
8
# File 'app/services/command_tower/messaging/recipient_readiness/channel_result.rb', line 6

def platform_enabled
  @platform_enabled
end

#readyObject (readonly)

Returns the value of attribute ready

Returns:

  • (Object)

    the current value of ready



6
7
8
# File 'app/services/command_tower/messaging/recipient_readiness/channel_result.rb', line 6

def ready
  @ready
end

#reason_codesObject (readonly)

Returns the value of attribute reason_codes

Returns:

  • (Object)

    the current value of reason_codes



6
7
8
# File 'app/services/command_tower/messaging/recipient_readiness/channel_result.rb', line 6

def reason_codes
  @reason_codes
end

#recipient_readyObject (readonly)

Returns the value of attribute recipient_ready

Returns:

  • (Object)

    the current value of recipient_ready



6
7
8
# File 'app/services/command_tower/messaging/recipient_readiness/channel_result.rb', line 6

def recipient_ready
  @recipient_ready
end

#resolved_endpoint_idObject (readonly)

Returns the value of attribute resolved_endpoint_id

Returns:

  • (Object)

    the current value of resolved_endpoint_id



6
7
8
# File 'app/services/command_tower/messaging/recipient_readiness/channel_result.rb', line 6

def resolved_endpoint_id
  @resolved_endpoint_id
end

#statusObject (readonly)

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



6
7
8
# File 'app/services/command_tower/messaging/recipient_readiness/channel_result.rb', line 6

def status
  @status
end

#verification_requiredObject (readonly)

Returns the value of attribute verification_required

Returns:

  • (Object)

    the current value of verification_required



6
7
8
# File 'app/services/command_tower/messaging/recipient_readiness/channel_result.rb', line 6

def verification_required
  @verification_required
end

Class Method Details

.build(channel_key:, ready:, platform_enabled:, platform_configured:, recipient_ready:, status:, reason_codes:, endpoint_count:, eligible_endpoint_count:, eligible_endpoint_ids:, verification_required:, resolved_endpoint_id: nil, evaluated_at: Time.current) ⇒ Object



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/recipient_readiness/channel_result.rb', line 21

def self.build(
  channel_key:,
  ready:,
  platform_enabled:,
  platform_configured:,
  recipient_ready:,
  status:,
  reason_codes:,
  endpoint_count:,
  eligible_endpoint_count:,
  eligible_endpoint_ids:,
  verification_required:,
  resolved_endpoint_id: nil,
  evaluated_at: Time.current
)
  new(
    channel_key: channel_key.to_s,
    ready: !!ready,
    platform_enabled: !!platform_enabled,
    platform_configured: !!platform_configured,
    recipient_ready: !!recipient_ready,
    status: status.to_s,
    reason_codes: Array(reason_codes).map(&:to_s).freeze,
    endpoint_count: Integer(endpoint_count),
    eligible_endpoint_count: Integer(eligible_endpoint_count),
    eligible_endpoint_ids: Array(eligible_endpoint_ids).map { |id| Integer(id) }.freeze,
    resolved_endpoint_id: resolved_endpoint_id.nil? ? nil : Integer(resolved_endpoint_id),
    verification_required: !!verification_required,
    evaluated_at:,
  ).freeze
end