Class: VAProfile::Models::CommunicationChannel
- Inherits:
-
CommunicationBase
- Object
- CommunicationBase
- VAProfile::Models::CommunicationChannel
- Defined in:
- lib/va_profile/models/communication_channel.rb
Instance Attribute Summary collapse
-
#communication_permission ⇒ Object
Returns the value of attribute communication_permission.
-
#default_send_indicator ⇒ Object
Returns the value of attribute default_send_indicator.
-
#description ⇒ Object
Returns the value of attribute description.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#communication_permission ⇒ Object
Returns the value of attribute communication_permission.
10 11 12 |
# File 'lib/va_profile/models/communication_channel.rb', line 10 def @communication_permission end |
#default_send_indicator ⇒ Object
Returns the value of attribute default_send_indicator.
9 10 11 |
# File 'lib/va_profile/models/communication_channel.rb', line 9 def default_send_indicator @default_send_indicator end |
#description ⇒ Object
Returns the value of attribute description.
9 10 11 |
# File 'lib/va_profile/models/communication_channel.rb', line 9 def description @description end |
#id ⇒ Object
Returns the value of attribute id.
9 10 11 |
# File 'lib/va_profile/models/communication_channel.rb', line 9 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
9 10 11 |
# File 'lib/va_profile/models/communication_channel.rb', line 9 def name @name end |
Class Method Details
.create_from_api(communication_channel_data, communication_item_id, default_send_indicator, permission_res) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/va_profile/models/communication_channel.rb', line 16 def self.create_from_api(communication_channel_data, communication_item_id, default_send_indicator, ) communication_channel_model = new( id: communication_channel_data['communication_channel_id'], name: communication_channel_data['name'], description: communication_channel_data['description'], default_send_indicator: ) = ['bios']&.find do || ['communication_item_id'] == communication_item_id && ['communication_channel_id'] == communication_channel_data['communication_channel_id'] end if .present? communication_channel_model. = VAProfile::Models::CommunicationPermission.new( id: ['communication_permission_id'], allowed: ['allowed'] ) end communication_channel_model end |
Instance Method Details
#communication_permission_valid ⇒ Object (private)
52 53 54 55 56 |
# File 'lib/va_profile/models/communication_channel.rb', line 52 def if .present? && .invalid? errors.add(:communication_permission, .errors..join(',')) end end |