fadendaten/six_saferpay

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

Summary

Maintainability
A
35 mins
Test Coverage
module SixSaferpay
  class UpdatePaymentMeans

    attr_accessor(:card)

    def initialize(card: nil)
      @card = SixSaferpay::AliasCard.new(**card.to_h) if card
    end

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

  end
end