Class: SpreeCmCommissioner::Integrations::Larryta::Polling::SyncRoutes
- Inherits:
-
Object
- Object
- SpreeCmCommissioner::Integrations::Larryta::Polling::SyncRoutes
- Defined in:
- app/services/spree_cm_commissioner/integrations/larryta/polling/sync_routes.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(integration:, sync_result: nil) ⇒ SyncRoutes
constructor
A new instance of SyncRoutes.
Constructor Details
#initialize(integration:, sync_result: nil) ⇒ SyncRoutes
Returns a new instance of SyncRoutes.
3 4 5 6 |
# File 'app/services/spree_cm_commissioner/integrations/larryta/polling/sync_routes.rb', line 3 def initialize(integration:, sync_result: nil) @integration = integration @sync_result = sync_result || SpreeCmCommissioner::Integrations::Base::SyncResult.new end |
Instance Method Details
#call ⇒ Object
8 9 10 11 12 13 14 |
# File 'app/services/spree_cm_commissioner/integrations/larryta/polling/sync_routes.rb', line 8 def call raise SpreeCmCommissioner::Integrations::SyncError, 'Integration must have a vendor to sync routes' if @integration.vendor.blank? synced_route_mappings = sync_items! cleanup_stale_mappings!(synced_route_mappings) end |