ruby how2basic.rb

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ruby how2basic.rb相关的知识,希望对你有一定的参考价值。

class TransactionManager

  attr_accessor :transation_type,
                :payment_type,
                :description,
                :amount,
                :transaction_date,
                :payment_processor,
                :payment_gateway

  def initialize(transaction_type: Transaction::TRANSACTION_TYPES.DirectDebit,
                 payment_type: Transaction::PAYMENT_TYPES.DirectDebit,
                 description: nil,
                 amount: 0,
                 transaction_date: Date.today,
                 payment_processor: PaymentProcessor.new,
                 payment_gateway: PaymentGateway.new)

    self.transaction_type       = transaction_type
    self.payment_type           = payment_type
    self.description            = description
    self.amount                 = amount
    self.payment_processor      = payment_processor
    self.payment_gateway        = payment_gateway
  end

以上是关于ruby how2basic.rb的主要内容,如果未能解决你的问题,请参考以下文章

Ruby运算符

Ruby 25 岁了!Ruby 之父说 Ruby 3 有望 3 倍提速

如何学习ruby?Ruby学习技巧分享

ruby Ruby脚本,看看是否用openssl编译了ruby

什么是ruby?

ruby和ruby ee