Module: Maestrano::Connector::Rails::Concerns::EntityBase
- Extended by:
- ActiveSupport::Concern
- Included in:
- EntityBase
- Defined in:
- app/models/maestrano/connector/rails/concerns/entity_base.rb
Instance Method Summary collapse
- #after_sync(last_synchronization_date) ⇒ Object
- #before_sync(last_synchronization_date) ⇒ Object
-
#filter_connec_entities(entities) ⇒ Object
This method is called during the webhook workflow only.
- #initialize(organization, connec_client, external_client, opts = {}) ⇒ Object
- #opts_merge!(opts) ⇒ Object
Instance Method Details
#after_sync(last_synchronization_date) ⇒ Object
19 20 21 |
# File 'app/models/maestrano/connector/rails/concerns/entity_base.rb', line 19 def after_sync(last_synchronization_date) # Does nothing by default end |
#before_sync(last_synchronization_date) ⇒ Object
15 16 17 |
# File 'app/models/maestrano/connector/rails/concerns/entity_base.rb', line 15 def before_sync(last_synchronization_date) # Does nothing by default end |
#filter_connec_entities(entities) ⇒ Object
This method is called during the webhook workflow only. It should return the hash of arrays of filtered entities The aim is to have the same filtering as with the Connec! filters on API calls in the webhooks input : For non complex entities [unmapped_external_entity1, unmapped_external_entity2] For complex entities
external_entities_names[0]: [unmapped_external_entity1, unmapped_external_entity2],
external_entities_names[1]: [unmapped_external_entity3, unmapped_external_entity4]
31 32 33 |
# File 'app/models/maestrano/connector/rails/concerns/entity_base.rb', line 31 def filter_connec_entities(entities) entities end |
#initialize(organization, connec_client, external_client, opts = {}) ⇒ Object
4 5 6 7 8 9 |
# File 'app/models/maestrano/connector/rails/concerns/entity_base.rb', line 4 def initialize(organization, connec_client, external_client, opts = {}) @organization = organization @connec_client = connec_client @external_client = external_client @opts = opts end |
#opts_merge!(opts) ⇒ Object
11 12 13 |
# File 'app/models/maestrano/connector/rails/concerns/entity_base.rb', line 11 def opts_merge!(opts) @opts.merge!(opts) end |