Class: VAProfile::Models::CommunicationItemGroup
- Inherits:
-
CommunicationBase
- Object
- CommunicationBase
- VAProfile::Models::CommunicationItemGroup
- Defined in:
- lib/va_profile/models/communication_item_group.rb
Instance Attribute Summary collapse
-
#communication_items ⇒ Object
Returns the value of attribute communication_items.
-
#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 Attribute Details
#communication_items ⇒ Object
Returns the value of attribute communication_items.
9 10 11 |
# File 'lib/va_profile/models/communication_item_group.rb', line 9 def communication_items @communication_items end |
#description ⇒ Object
Returns the value of attribute description.
9 10 11 |
# File 'lib/va_profile/models/communication_item_group.rb', line 9 def description @description end |
#id ⇒ Object
Returns the value of attribute id.
9 10 11 |
# File 'lib/va_profile/models/communication_item_group.rb', line 9 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
9 10 11 |
# File 'lib/va_profile/models/communication_item_group.rb', line 9 def name @name end |
Class Method Details
.create_groups(items_res, permission_res) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/va_profile/models/communication_item_group.rb', line 11 def self.create_groups(items_res, ) groups = {} items_res['bios'].each do |communication_item| communication_item_group = communication_item['communication_item_groups'][0] communication_group_id = communication_item_group['communication_group_id'] groups[communication_group_id] ||= new( id: communication_group_id, name: communication_item_group['communication_group']['name'], description: communication_item_group['communication_group']['description'], communication_items: [] ) groups[communication_group_id].communication_items << VAProfile::Models::CommunicationItem.create_from_api(communication_item, ) end groups.values end |