Ruby Ruby Objects and Classes Build a Bank Account Class Create a BankAccount Class

PoJung Chen
PoJung Chen
5,856 Points

I am no sure where the code error in Ruby - Object and Classes challenge

I enter the code below:

create a BankAccount class

class BankAccount def initialize(name, transactions) @name = name @transactions = Array.new end end

I continue getting the error message showing that "It looks like Task 2 is no longer exists". However, after I go back to Task 2, I pass the task with the same code. Any idea for the problems?

bank_account.rb
# create a BankAccount class
class BankAccount
  def initialize(name, transactions)
    @name = name
    @transactions = Array.new
  end
end

2 Answers

Robert Hopman
Robert Hopman
16,502 Points

Correct code below

class BankAccount
  def initialize(name)
    @name = name
    @transactions = Array.new
  end
end
PoJung Chen
PoJung Chen
5,856 Points

I find what the error from. I need to remove the arguments "transactions" in parentheses.