Module: PaymentRails::GatewayHelper

Included in:
BatchGateway, InvoiceGateway, InvoicePaymentGateway, OfflinePaymentGateway, PaymentGateway, RecipientAccountGateway, RecipientGateway
Defined in:
lib/paymentrails/gateways/GatewayHelper.rb

Instance Method Summary collapse

Instance Method Details

#loosely_hydrate_model(klass_instance, attributes) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/paymentrails/gateways/GatewayHelper.rb', line 3

def loosely_hydrate_model(klass_instance, attributes)
  attributes.each do |k, v|
    begin
      klass_instance.send("#{k}=", v)
    rescue NoMethodError
      warn "[PaymentRails] Unknown attribute #{k} for class #{klass_instance.class.name}"
    end
  end

  klass_instance
end