Class: CardDB::Rails::DeckSyncService
- Inherits:
-
Object
- Object
- CardDB::Rails::DeckSyncService
- Defined in:
- lib/carddb/rails/deck_sync_service.rb
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(external_ref:, input:, client: nil) ⇒ DeckSyncService
constructor
A new instance of DeckSyncService.
Constructor Details
#initialize(external_ref:, input:, client: nil) ⇒ DeckSyncService
Returns a new instance of DeckSyncService.
10 11 12 13 14 |
# File 'lib/carddb/rails/deck_sync_service.rb', line 10 def initialize(external_ref:, input:, client: nil) @external_ref = external_ref @input = input @client = client || CardDB::Rails.client end |
Class Method Details
.call(external_ref:, input:, client: nil) ⇒ Object
6 7 8 |
# File 'lib/carddb/rails/deck_sync_service.rb', line 6 def self.call(external_ref:, input:, client: nil) new(external_ref: external_ref, input: input, client: client).call end |
Instance Method Details
#call ⇒ Object
16 17 18 |
# File 'lib/carddb/rails/deck_sync_service.rb', line 16 def call @client.decks.upsert_by_external_ref(input: @input.merge(externalRef: @external_ref)) end |