Module: Cryptopay::Callback

Defined in:
lib/cryptopay/models/callback.rb

Class Method Summary collapse

Class Method Details

.build_from_hash(data) ⇒ Cryptopay::ChannelPaymentCallback, ...

Builds the object

Parameters:

  • Data (Mixed)

    to be matched against the list of oneOf items

Returns:



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/cryptopay/models/callback.rb', line 14

def self.build_from_hash(data)
  case data[DISCRIMINATOR_NAME]
  when 'ChannelPayment'
    ChannelPaymentCallback.build_from_hash(data)
  when 'CoinWithdrawal'
    CoinWithdrawalCallback.build_from_hash(data)
  when 'Invoice'
    InvoiceCallback.build_from_hash(data)
  when 'Subscription'
    SubscriptionCallback.build_from_hash(data)
  end
end