From c4b32410eb59c7a4c2d4cc7bc520b3e53ff48457 Mon Sep 17 00:00:00 2001 From: Yordanos Date: Wed, 2 Mar 2016 16:49:19 -0800 Subject: [PATCH 1/6] Sorry, I forgot to commit while I was working on the project. I've added account, owner and display class. There is a self.find method in both the account and owner class that return the instance of the account given an id. I also have a self.all method for the account and owner class that generates the account info/owner info using the csv file. --- bank_accounts.rb | 156 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 156 insertions(+) create mode 100644 bank_accounts.rb diff --git a/bank_accounts.rb b/bank_accounts.rb new file mode 100644 index 00000000..33857a49 --- /dev/null +++ b/bank_accounts.rb @@ -0,0 +1,156 @@ +require 'CSV' + +module Bank + class Account + attr_reader :id, :initial_balance, :current_balance, :owner, :account_info, :accounts, :balance + + def initialize(account) # account is a hash ex. Account.new(id: 1234, amount: 50) + + @id = account[:id] + @initial_balance = account[:initial_balance] + @current_balance = account[:initial_balance] + @balance = account[:initial_balance] + @open_date = account[:open_date] + # @account_info = {account: account} + + raise ArgumentError, "ERROR: invalid initial amount. Please try creating account" unless @initial_balance >= 0 + end + + def self.all + accounts = [] + account_info = CSV.read("./support/accounts.csv") + + account_info.each do |line| + accounts << self.new(id: line[0], initial_balance: line[1].to_i, open_date: line[2]) + end + + return accounts + end + + def self.find(id) + accounts = Bank::Account.all + accounts.each do |line| + # puts "line #{line} = #{@accounts[line].id.to_i}" + if id.to_i == line.id.to_i + return line + end + end + end + + def self.owner_account + accounts_csv = self.all + owner_csv = Bank::Owner.all + account_owner = [] + + account_owner_csv = CSV.read("./support/account_owners.csv") # get account_id and owner_id + + account_owner_csv.each do |line| + account_info = Bank::Account.find((line[0].to_i)) + owner_info = Bank::Owner.find((line[1].to_i)) + account_owner << [account_info, owner_info] + # account_owner << [account_info: account_info, owner_info: owner_info] + + end + return account_owner + end + + + def withdraw (withdraw_amount) # parameter represents the amount of money that will be withdrawn + if @balance < withdraw_amount + @current_balance = @balance - withdraw_amount + else + puts "WARNING: invalid withdraw amount. Current balance is: #{@current_balance}" + end + return @current_balance # return the updated account balance. + end + + def deposit(deposit_amount) # parameter which represents the amount of money that will be deposited. + @current_balance = @current_balance + deposit_amount + return @current_balance + end + + def current_balance + return @current_balance + end + + def owner_info (owner) + @account_info[:owner]= (owner.owner_property[:owner]) + end + end + + class Owner + attr_reader :id, :last_name, :first_name, :address, :street_address, :city, :state + def initialize (owner_info) + if owner_info != nil + @id = owner_info [:id] + @last_name = owner_info[:last_name] + @first_name = owner_info[:first_name] + @address = owner_info[:address] + @street_address = owner_info[:street_address] + @city = owner_info[:city] + @state = owner_info[:state] + end + end + + def self.all + owner_info = [] + owner_info_csv = CSV.read("./support/owners.csv") + + owner_info_csv.each do |line| + owner_info << self.new(id: line[0].to_i, last_name: line[1], first_name: line[2], address: line[3], street_address: line[4], city: line[5], state: line[6]) + + end + return owner_info + end + + def self.find(id) + owner_all = Bank::Owner.all + owner_all.each_index do |line| + # puts "line #{line} = #{@accounts[line].id.to_i}" + if id.to_i == owner_all[line].id.to_i + return owner_all[line] + end + end + end + + def owner_property #track info about who owns the account + return @owner_property + end + end + + class Display + attr_reader :view + + def initialize + view + end + + def self.view + account_all = Bank::Account.owner_account + puts "Account List" + account_all.each do |account| + puts "Account ID: #{account[0].id} Owner ID: #{account[1].id} Balance: #{account[0].balance} Name: #{account[1].first_name} #{account[1].last_name} " + end + return nil + end + end + +end + +# @joe_account = Bank::Account.new(id: 1234, amount: 50) +# @joe_info = Bank::Owner.new(name: "Joe", address: {street: "1234 Lane Drive", city: "Oaklad", state: "CA", zip: 94612}) + +# def add_owner(add_owner_info) +# @owner_property.push(add_owner_info) +# @owner_property +# end +# +# def self.find(id) +# accounts = Bank::Account.all +# accounts.each_index do |line| +# # puts "line #{line} = #{@accounts[line].id.to_i}" +# if id.to_i == accounts[line].id.to_i +# return accounts[line] +# end +# end +# end From ffae0b4747d22891e5de499c28c106b5679c679d Mon Sep 17 00:00:00 2001 From: Yordanos Date: Wed, 2 Mar 2016 17:34:22 -0800 Subject: [PATCH 2/6] Added accounts method in the owners class that returns the owners of an account. --- bank_accounts.rb | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/bank_accounts.rb b/bank_accounts.rb index 33857a49..bc48fe66 100644 --- a/bank_accounts.rb +++ b/bank_accounts.rb @@ -116,6 +116,15 @@ def self.find(id) def owner_property #track info about who owns the account return @owner_property end + + def accounts + accounts = Bank::Account.owner_account + accounts.each do |line| + if id == line[1].id + return line + end + end + end end class Display @@ -136,21 +145,3 @@ def self.view end end - -# @joe_account = Bank::Account.new(id: 1234, amount: 50) -# @joe_info = Bank::Owner.new(name: "Joe", address: {street: "1234 Lane Drive", city: "Oaklad", state: "CA", zip: 94612}) - -# def add_owner(add_owner_info) -# @owner_property.push(add_owner_info) -# @owner_property -# end -# -# def self.find(id) -# accounts = Bank::Account.all -# accounts.each_index do |line| -# # puts "line #{line} = #{@accounts[line].id.to_i}" -# if id.to_i == accounts[line].id.to_i -# return accounts[line] -# end -# end -# end From 4401f69a7411203c3a00b91b84901b02d3af7660 Mon Sep 17 00:00:00 2001 From: Yordanos Date: Thu, 3 Mar 2016 13:26:19 -0800 Subject: [PATCH 3/6] created a new method called argument_error that runs in the initialize method that will check if value is greater than initial_balance_min. --- bank_accounts.rb | 61 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 60 insertions(+), 1 deletion(-) diff --git a/bank_accounts.rb b/bank_accounts.rb index bc48fe66..a7595469 100644 --- a/bank_accounts.rb +++ b/bank_accounts.rb @@ -12,8 +12,10 @@ def initialize(account) # account is a hash ex. Account.new(id: 1234, amount: 50 @balance = account[:initial_balance] @open_date = account[:open_date] # @account_info = {account: account} + end - raise ArgumentError, "ERROR: invalid initial amount. Please try creating account" unless @initial_balance >= 0 + def argument_error + raise ArgumentError, "ERROR: invalid initial amount. Please deposit more than $#{@initial_balance_min}. Please try creating an account again" unless @initial_balance >= @initial_balance_min end def self.all @@ -144,4 +146,61 @@ def self.view end end +# 1. Create a SavingsAccount class which should inherit behavior from the Account class. +# 1. It should include the following updated functionality: +# § The initial balance cannot be less than $10. If it is, this will raise an ArgumentError +# § Updated withdrawal functionality: +# □ Each withdrawal 'transaction' incurs a fee of $2 that is taken out of the balance. +# Does not allow the account to go below the $10 minimum balance - Will output a warning message and return the original un-modified balance + + class SavingsAccount < Account + TRANSACION_FEE = 2 + MINIMUM_BALANCE = 10 + attr_reader :id, :initial_balance, :current_balance, :owner, :account_info, :accounts, :balance + + def initialize(account) + + @id = account[:id] + @initial_balance = account[:initial_balance] + @current_balance = account[:initial_balance] + @balance = account[:initial_balance] + @open_date = account[:open_date] + # @account_info = {account: account} + + raise ArgumentError, "ERROR: invalid initial amount. Please try creating account" unless @initial_balance >= 10 + end + + def withdraw (withdraw_amount) # parameter represents the amount of money that will be withdrawn + new_balance = @balance - TRANSACION_FEE - withdraw_amount + if new_balance > withdraw_amount + @current_balance = @balance - withdraw_amount + else + puts "WARNING: invalid withdraw amount. Current balance is: #{@current_balance}" + end + return @current_balance # return the updated account balance. + end + + def withdraw (withdraw_amount) # parameter represents the amount of money that will be withdrawn + new_balance = @balance - TRANSACION_FEE - withdraw_amount + if new_balance >= 10 + @current_balance = new_balance + else + puts "WARNING: invalid withdraw amount. Current balance is: #{@current_balance}" + end + return @current_balance # return the updated account balance. + end + + def deposit(deposit_amount) # parameter which represents the amount of money that will be deposited. + @current_balance = @current_balance + deposit_amount + return @current_balance + end + + def current_balance + return @current_balance + end + + def owner_info (owner) + @account_info[:owner]= (owner.owner_property[:owner]) + end + end end From e3ab49139c5f877be8acd0713908514fc6c3cd8f Mon Sep 17 00:00:00 2001 From: Yordanos Date: Fri, 4 Mar 2016 10:51:27 -0800 Subject: [PATCH 4/6] completed the MoneyMarketAccount --- bank_accounts.rb | 206 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 152 insertions(+), 54 deletions(-) diff --git a/bank_accounts.rb b/bank_accounts.rb index a7595469..94a6d453 100644 --- a/bank_accounts.rb +++ b/bank_accounts.rb @@ -2,20 +2,30 @@ module Bank class Account + TRANSACION_FEE = 0 + INITIAL_BALANCE_MIN = 0 + MINIMUM_ACCOUNT_BALANCE = 0 + attr_reader :id, :initial_balance, :current_balance, :owner, :account_info, :accounts, :balance def initialize(account) # account is a hash ex. Account.new(id: 1234, amount: 50) + @id = account[:id] + @initial_balance = account[:initial_balance] + @current_balance = account[:initial_balance] + @balance = account[:initial_balance] + @open_date = account[:open_date] + account_values + argument_error + end - @id = account[:id] - @initial_balance = account[:initial_balance] - @current_balance = account[:initial_balance] - @balance = account[:initial_balance] - @open_date = account[:open_date] - # @account_info = {account: account} + def account_values(min_account_balance = MINIMUM_ACCOUNT_BALANCE, initial_balance_min = INITIAL_BALANCE_MIN, transaction_fee = TRANSACION_FEE) + @min_account_balance = min_account_balance + @initial_balance_min = initial_balance_min + @transaction_fee = transaction_fee end def argument_error - raise ArgumentError, "ERROR: invalid initial amount. Please deposit more than $#{@initial_balance_min}. Please try creating an account again" unless @initial_balance >= @initial_balance_min + raise ArgumentError, "ERROR: invalid initial amount. Please deposit more than $#{@initial_balance_min}. Please try again" unless @initial_balance >= @initial_balance_min end def self.all @@ -25,7 +35,6 @@ def self.all account_info.each do |line| accounts << self.new(id: line[0], initial_balance: line[1].to_i, open_date: line[2]) end - return accounts end @@ -56,14 +65,21 @@ def self.owner_account return account_owner end - def withdraw (withdraw_amount) # parameter represents the amount of money that will be withdrawn - if @balance < withdraw_amount - @current_balance = @balance - withdraw_amount + new_balance = @current_balance - @transaction_fee - withdraw_amount + + if new_balance >= @min_account_balance + @current_balance = new_balance else - puts "WARNING: invalid withdraw amount. Current balance is: #{@current_balance}" + withdraw_error end + return @current_balance # return the updated account balance. + + end + + def withdraw_error + puts "WARNING: invalid withdraw amount. Current balance is: #{@current_balance}" end def deposit(deposit_amount) # parameter which represents the amount of money that will be deposited. @@ -83,15 +99,13 @@ def owner_info (owner) class Owner attr_reader :id, :last_name, :first_name, :address, :street_address, :city, :state def initialize (owner_info) - if owner_info != nil - @id = owner_info [:id] - @last_name = owner_info[:last_name] - @first_name = owner_info[:first_name] - @address = owner_info[:address] - @street_address = owner_info[:street_address] - @city = owner_info[:city] - @state = owner_info[:state] - end + @id = owner_info [:id] + @last_name = owner_info[:last_name] + @first_name = owner_info[:first_name] + @address = owner_info[:address] + @street_address = owner_info[:street_address] + @city = owner_info[:city] + @state = owner_info[:state] end def self.all @@ -100,7 +114,6 @@ def self.all owner_info_csv.each do |line| owner_info << self.new(id: line[0].to_i, last_name: line[1], first_name: line[2], address: line[3], street_address: line[4], city: line[5], state: line[6]) - end return owner_info end @@ -138,51 +151,69 @@ def initialize def self.view account_all = Bank::Account.owner_account - puts "Account List" - account_all.each do |account| + puts "Account List" + account_all.each do |account| puts "Account ID: #{account[0].id} Owner ID: #{account[1].id} Balance: #{account[0].balance} Name: #{account[1].first_name} #{account[1].last_name} " end return nil end end -# 1. Create a SavingsAccount class which should inherit behavior from the Account class. -# 1. It should include the following updated functionality: -# § The initial balance cannot be less than $10. If it is, this will raise an ArgumentError -# § Updated withdrawal functionality: -# □ Each withdrawal 'transaction' incurs a fee of $2 that is taken out of the balance. -# Does not allow the account to go below the $10 minimum balance - Will output a warning message and return the original un-modified balance - class SavingsAccount < Account TRANSACION_FEE = 2 - MINIMUM_BALANCE = 10 - attr_reader :id, :initial_balance, :current_balance, :owner, :account_info, :accounts, :balance + INITIAL_BALANCE_MIN = 10 + MINIMUM_ACCOUNT_BALANCE = 10 - def initialize(account) + attr_reader :id, :initial_balance, :current_balance, :owner, :account_info, :accounts, :balance - @id = account[:id] - @initial_balance = account[:initial_balance] - @current_balance = account[:initial_balance] - @balance = account[:initial_balance] - @open_date = account[:open_date] - # @account_info = {account: account} + def account_constants + super(MINIMUM_ACCOUNT_BALANCE, INITIAL_BALANCE_MIN, TRANSACION_FEE) + end - raise ArgumentError, "ERROR: invalid initial amount. Please try creating account" unless @initial_balance >= 10 + def add_interest(rate) + interest_on_balance = @current_balance * (rate/100) # formula for calculating interest is balance * rate/100 + @current_balance = @current_balance + interest_on_balance + puts "Interest earned on balance is #{interest_on_balance} and current balance is #{@current_balance}" + return interest_on_balance end + def withdraw (withdraw_amount) # parameter represents the amount of money that will be withdrawn - new_balance = @balance - TRANSACION_FEE - withdraw_amount - if new_balance > withdraw_amount - @current_balance = @balance - withdraw_amount + new_balance = @current_balance - @transaction_fee - withdraw_amount + if new_balance >= @min_account_balance + @current_balance = new_balance else puts "WARNING: invalid withdraw amount. Current balance is: #{@current_balance}" end return @current_balance # return the updated account balance. end - def withdraw (withdraw_amount) # parameter represents the amount of money that will be withdrawn - new_balance = @balance - TRANSACION_FEE - withdraw_amount - if new_balance >= 10 + end + + class CheckingAccount < Account + TRANSACION_FEE = 1 + INITIAL_BALANCE_MIN = 10 + MINIMUM_ACCOUNT_BALANCE = 0 # for withdraw but not for check withdrawals + + attr_reader :id, :initial_balance, :current_balance, :owner, :account_info, :accounts, :balance + + def account_values + super(MINIMUM_ACCOUNT_BALANCE, INITIAL_BALANCE_MIN, TRANSACION_FEE) + @check_withdraw_count = 0 + @transaction_check_fee = 0 + end + + def reset_check_count + @check_withdraw_count = 0 + end + + def withdraw_using_check (withdraw_amount) # parameter represents the amount of money that will be withdrawn + check_min = -10 + new_balance = @current_balance - @transaction_check_fee - withdraw_amount + if new_balance >= check_min + check_count + puts "transaction_fee #{@transaction_fee}" + puts "check count #{@check_withdraw_count}" @current_balance = new_balance else puts "WARNING: invalid withdraw amount. Current balance is: #{@current_balance}" @@ -190,17 +221,84 @@ def withdraw (withdraw_amount) # parameter represents the amount of money that w return @current_balance # return the updated account balance. end - def deposit(deposit_amount) # parameter which represents the amount of money that will be deposited. - @current_balance = @current_balance + deposit_amount - return @current_balance + def check_count + @check_withdraw_count += 1 + if @check_withdraw_count > 3 + @transaction_check_fee = 2 + end end + end - def current_balance - return @current_balance + class MoneyMarketAccount < Account + TRANSACION_FEE = 0 + INITIAL_BALANCE_MIN = 10000 + MINIMUM_ACCOUNT_BALANCE = 0 # for withdraw but not for check withdrawals + + attr_reader :id, :initial_balance, :current_balance, :owner, :account_info, :accounts, :balance + + def account_values + super(MINIMUM_ACCOUNT_BALANCE, INITIAL_BALANCE_MIN, TRANSACION_FEE) + @check_withdraw_count = 0 + @transaction_check_fee = 0 + @total_transactions = 0 end - def owner_info (owner) - @account_info[:owner]= (owner.owner_property[:owner]) + def reset_check_count + @check_withdraw_count = 0 + @total_transactions = 0 + end + + def withdraw (amount) + if transaction? == true + balance = super(amount) + if balance < 10000 + @total_transactions += 1 + puts "Number of monthly transactions: #{@total_transactions}" + @current_balance = balance - 100 + else + @total_transactions += 1 + puts "Number of monthly transactions: #{@total_transactions}" + @current_balance = balance + end + end end + + def deposit (amount) + if @current_balance < 10000 + puts "Number of monthly transactions: #{@total_transactions}" + @current_balance = super(amount) + end + if transaction_count? == true + @total_transactions += 1 + puts "Number of monthly transactions: here #{@total_transactions}" + @current_balance = super(amount) + end + end + + def transaction_count? + if @total_transactions >= 6 + puts "You have reached your monthly transaction use. Please wait until next month to complete a transaction" + false + else + true + end + end + + def transaction? + min_account_balance = 10000 + if @current_balance >= min_account_balance && transaction_count? + true + elsif @current_balance < 10000 + puts "WARNING: invalid withdraw amount. Current balance is: #{@current_balance}" + end + end + + def add_interest(rate) + interest_on_balance = @current_balance * (rate/100) # formula for calculating interest is balance * rate/100 + @current_balance = @current_balance + interest_on_balance + puts "Interest earned on balance is #{interest_on_balance} and current balance is #{@current_balance}" + return interest_on_balance + end + end end From 202d54750bdcbf001f29910a5ce8e9c775596ecf Mon Sep 17 00:00:00 2001 From: Yordanos Date: Fri, 4 Mar 2016 12:57:43 -0800 Subject: [PATCH 5/6] removed put statements that I was using to coung the number of @total_transactions --- bank_accounts.rb | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/bank_accounts.rb b/bank_accounts.rb index 94a6d453..4984f702 100644 --- a/bank_accounts.rb +++ b/bank_accounts.rb @@ -14,6 +14,7 @@ def initialize(account) # account is a hash ex. Account.new(id: 1234, amount: 50 @current_balance = account[:initial_balance] @balance = account[:initial_balance] @open_date = account[:open_date] + @owner_info = account[:owner_info] account_values argument_error end @@ -59,8 +60,6 @@ def self.owner_account account_info = Bank::Account.find((line[0].to_i)) owner_info = Bank::Owner.find((line[1].to_i)) account_owner << [account_info, owner_info] - # account_owner << [account_info: account_info, owner_info: owner_info] - end return account_owner end @@ -91,8 +90,8 @@ def current_balance return @current_balance end - def owner_info (owner) - @account_info[:owner]= (owner.owner_property[:owner]) + def add_owner (owner) + @owner_info = Bank::Owner.new(owner) end end @@ -106,6 +105,7 @@ def initialize (owner_info) @street_address = owner_info[:street_address] @city = owner_info[:city] @state = owner_info[:state] + @account_info = owner_info[:account_info] end def self.all @@ -137,9 +137,15 @@ def accounts accounts.each do |line| if id == line[1].id return line + else + nil end end end + + def add_account (account) + @account_info = Bank::Account.new(account) + end end class Display @@ -166,7 +172,7 @@ class SavingsAccount < Account attr_reader :id, :initial_balance, :current_balance, :owner, :account_info, :accounts, :balance - def account_constants + def account_values super(MINIMUM_ACCOUNT_BALANCE, INITIAL_BALANCE_MIN, TRANSACION_FEE) end @@ -212,8 +218,6 @@ def withdraw_using_check (withdraw_amount) # parameter represents the amount of new_balance = @current_balance - @transaction_check_fee - withdraw_amount if new_balance >= check_min check_count - puts "transaction_fee #{@transaction_fee}" - puts "check count #{@check_withdraw_count}" @current_balance = new_balance else puts "WARNING: invalid withdraw amount. Current balance is: #{@current_balance}" @@ -253,11 +257,11 @@ def withdraw (amount) balance = super(amount) if balance < 10000 @total_transactions += 1 - puts "Number of monthly transactions: #{@total_transactions}" - @current_balance = balance - 100 + below_min_fee = 100 + puts "Balance is below $10,000, a fee of $100 is imposed." + @current_balance = balance - below_min_fee else @total_transactions += 1 - puts "Number of monthly transactions: #{@total_transactions}" @current_balance = balance end end @@ -265,12 +269,10 @@ def withdraw (amount) def deposit (amount) if @current_balance < 10000 - puts "Number of monthly transactions: #{@total_transactions}" @current_balance = super(amount) end if transaction_count? == true @total_transactions += 1 - puts "Number of monthly transactions: here #{@total_transactions}" @current_balance = super(amount) end end From f1c56b8f2660c196196c2c42672d78303ef03dce Mon Sep 17 00:00:00 2001 From: Yordanos Date: Fri, 4 Mar 2016 13:08:24 -0800 Subject: [PATCH 6/6] changed current_balance method in accounts to balance --- bank_accounts.rb | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/bank_accounts.rb b/bank_accounts.rb index 4984f702..60afd7bf 100644 --- a/bank_accounts.rb +++ b/bank_accounts.rb @@ -6,13 +6,12 @@ class Account INITIAL_BALANCE_MIN = 0 MINIMUM_ACCOUNT_BALANCE = 0 - attr_reader :id, :initial_balance, :current_balance, :owner, :account_info, :accounts, :balance + attr_reader :id, :initial_balance, :current_balance, :owner, :account_info, :accounts def initialize(account) # account is a hash ex. Account.new(id: 1234, amount: 50) @id = account[:id] @initial_balance = account[:initial_balance] @current_balance = account[:initial_balance] - @balance = account[:initial_balance] @open_date = account[:open_date] @owner_info = account[:owner_info] account_values @@ -86,7 +85,7 @@ def deposit(deposit_amount) # parameter which represents the amount of money t return @current_balance end - def current_balance + def balance return @current_balance end @@ -96,7 +95,7 @@ def add_owner (owner) end class Owner - attr_reader :id, :last_name, :first_name, :address, :street_address, :city, :state + attr_reader :id, :last_name, :first_name, :address, :street_address, :city, :state, :account_info def initialize (owner_info) @id = owner_info [:id] @last_name = owner_info[:last_name] @@ -170,7 +169,7 @@ class SavingsAccount < Account INITIAL_BALANCE_MIN = 10 MINIMUM_ACCOUNT_BALANCE = 10 - attr_reader :id, :initial_balance, :current_balance, :owner, :account_info, :accounts, :balance + attr_reader :id, :initial_balance, :current_balance, :owner, :account_info, :accounts def account_values super(MINIMUM_ACCOUNT_BALANCE, INITIAL_BALANCE_MIN, TRANSACION_FEE) @@ -201,7 +200,7 @@ class CheckingAccount < Account INITIAL_BALANCE_MIN = 10 MINIMUM_ACCOUNT_BALANCE = 0 # for withdraw but not for check withdrawals - attr_reader :id, :initial_balance, :current_balance, :owner, :account_info, :accounts, :balance + attr_reader :id, :initial_balance, :current_balance, :owner, :account_info, :accounts def account_values super(MINIMUM_ACCOUNT_BALANCE, INITIAL_BALANCE_MIN, TRANSACION_FEE) @@ -238,7 +237,7 @@ class MoneyMarketAccount < Account INITIAL_BALANCE_MIN = 10000 MINIMUM_ACCOUNT_BALANCE = 0 # for withdraw but not for check withdrawals - attr_reader :id, :initial_balance, :current_balance, :owner, :account_info, :accounts, :balance + attr_reader :id, :initial_balance, :current_balance, :owner, :account_info, :accounts def account_values super(MINIMUM_ACCOUNT_BALANCE, INITIAL_BALANCE_MIN, TRANSACION_FEE)