module Cryptopay::Callback

Constants

DISCRIMINATOR_NAME

Public Class Methods

build_from_hash(data) click to toggle source

Builds the object @param [Mixed] Data to be matched against the list of oneOf items @return [Cryptopay::ChannelPaymentCallback, Cryptopay::CoinWithdrawalCallback, Cryptopay::InvoiceCallback, nil] Returns the model or nil

# 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)
  end
end