Class: Finix::PaymentInstrument

Inherits:
Object
  • Object
show all
Includes:
HypermediaRegistry, Resource, Verifiable
Defined in:
lib/finix/resources/payment_instrument.rb

Direct Known Subclasses

BankAccount, PaymentCard

Instance Attribute Summary

Attributes included from HalResource

#attributes, #hyperlinks

Class Method Summary collapse

Methods included from Verifiable

#verify

Methods included from HypermediaRegistry

included

Methods included from Resource

#copy_from, #fetch, #hydrate, included, #initialize, #inspect, #refresh, #sanitize, #save, #to_s

Methods included from HalResource

#method_missing

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Finix::HalResource

Class Method Details

.hypermedia_subtype(response) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/finix/resources/payment_instrument.rb', line 10

def hypermedia_subtype(response)
  unless response.nil?
    type = response['instrument_type'] || response['type']
    if type == 'PAYMENT_CARD'
      return Finix::PaymentCard
    elsif type == 'BANK_ACCOUNT'
      return Finix::BankAccount
    end
  end
  self
end