Sha256: 72dcf6d401da0eaa789f0f46518f99b697511e12ac83567331afea60b8afede8
Contents?: true
Size: 876 Bytes
Versions: 5
Compression:
Stored size: 876 Bytes
Contents
module LedgerSync module Adaptors module Test module Customer module Operations class Find < Operation::Find class Contract < LedgerSync::Adaptors::Contract params do required(:ledger_id).filled(:string) optional(:email).maybe(:string) optional(:name).maybe(:string) optional(:phone_number).maybe(:string) end end private def operate return failure(nil) if resource.ledger_id.nil? response = adaptor.find( resource: 'customer', id: resource.ledger_id ) success(response: response) rescue OAuth2::Error => e failure(e) end end end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems