Class: CommandTower::Messaging::RecipientReadiness::IdentityFacts
- Inherits:
-
Data
- Object
- Data
- CommandTower::Messaging::RecipientReadiness::IdentityFacts
- Defined in:
- app/services/command_tower/messaging/recipient_readiness/identity_facts.rb
Overview
Bounded identity facts for readiness. Schema reflection for phone support stays here until Identity ships canonical phone fields.
Instance Attribute Summary collapse
-
#email_present ⇒ Object
readonly
Returns the value of attribute email_present.
-
#email_supported ⇒ Object
readonly
Returns the value of attribute email_supported.
-
#email_validated ⇒ Object
readonly
Returns the value of attribute email_validated.
-
#phone_number_validated ⇒ Object
readonly
Returns the value of attribute phone_number_validated.
-
#phone_present ⇒ Object
readonly
Returns the value of attribute phone_present.
-
#phone_supported ⇒ Object
readonly
Returns the value of attribute phone_supported.
Class Method Summary collapse
Instance Attribute Details
#email_present ⇒ Object (readonly)
Returns the value of attribute email_present
8 9 10 |
# File 'app/services/command_tower/messaging/recipient_readiness/identity_facts.rb', line 8 def email_present @email_present end |
#email_supported ⇒ Object (readonly)
Returns the value of attribute email_supported
8 9 10 |
# File 'app/services/command_tower/messaging/recipient_readiness/identity_facts.rb', line 8 def email_supported @email_supported end |
#email_validated ⇒ Object (readonly)
Returns the value of attribute email_validated
8 9 10 |
# File 'app/services/command_tower/messaging/recipient_readiness/identity_facts.rb', line 8 def email_validated @email_validated end |
#phone_number_validated ⇒ Object (readonly)
Returns the value of attribute phone_number_validated
8 9 10 |
# File 'app/services/command_tower/messaging/recipient_readiness/identity_facts.rb', line 8 def phone_number_validated @phone_number_validated end |
#phone_present ⇒ Object (readonly)
Returns the value of attribute phone_present
8 9 10 |
# File 'app/services/command_tower/messaging/recipient_readiness/identity_facts.rb', line 8 def phone_present @phone_present end |
#phone_supported ⇒ Object (readonly)
Returns the value of attribute phone_supported
8 9 10 |
# File 'app/services/command_tower/messaging/recipient_readiness/identity_facts.rb', line 8 def phone_supported @phone_supported end |
Class Method Details
.for_user(user) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/services/command_tower/messaging/recipient_readiness/identity_facts.rb', line 16 def self.for_user(user) phone_supported = phone_capability_exposed?(user) new( email_supported: true, email_present: user.email.to_s.strip.present?, email_validated: !!user.email_validated, phone_supported:, phone_present: phone_supported && phone_value_present?(user), phone_number_validated: phone_supported && !!read_phone_validated(user), ).freeze end |