Class: NetworkManager
- Inherits:
-
Object
- Object
- NetworkManager
- Defined in:
- app/services/network_manager.rb
Overview
Network manager for interaction with central site
Direct Known Subclasses
CampaignHandler, CandidateHandler, PoliticalForceHandler, PostAttachmentHandler, PostHandler, PostTypeHandler, RegionHandler, UserHandler
Defined Under Namespace
Classes: CampaignHandler, CandidateHandler, PoliticalForceHandler, PostAttachmentHandler, PostHandler, PostTypeHandler, RegionHandler, UserHandler
Constant Summary collapse
- MAIN_HOST =
'https://comunit.online'
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#entity ⇒ Object
Returns the value of attribute entity.
Class Method Summary collapse
- .ignored_attributes ⇒ Object
- .permitted_attributes ⇒ Object
- .relationship_data(entity, wrap = true) ⇒ Object
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
7 8 9 |
# File 'app/services/network_manager.rb', line 7 def data @data end |
#entity ⇒ Object
Returns the value of attribute entity.
7 8 9 |
# File 'app/services/network_manager.rb', line 7 def entity @entity end |
Class Method Details
.ignored_attributes ⇒ Object
22 23 24 |
# File 'app/services/network_manager.rb', line 22 def self.ignored_attributes %w[data id image] end |
.permitted_attributes ⇒ Object
26 27 28 |
# File 'app/services/network_manager.rb', line 26 def self.permitted_attributes i[created_at sync_state] end |
.relationship_data(entity, wrap = true) ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'app/services/network_manager.rb', line 11 def self.relationship_data(entity, wrap = true) return nil if entity.nil? data = { id: entity.uuid, type: entity.class.table_name } wrap ? { data: data } : data end |