fadendaten/six_saferpay

View on GitHub
lib/six_saferpay/models/processing_data.rb

Summary

Maintainability
A
35 mins
Test Coverage
module SixSaferpay
  class ProcessingData

    attr_accessor(:bancontact)

    def initialize(bancontact: nil)
      @bancontact = SixSaferpay::Bancontact.new(**bancontact.to_h) if bancontact
    end

    def to_hash
      hash = Hash.new
      hash.merge!(bancontact: @bancontact.to_h) if @bancontact
      hash
    end
    alias_method :to_h, :to_hash

  end
end