34,333
edits
Changes
→Class Inheritance
54321
555-123-5433
</pre>
Note that the above example assumes the declaration of the BankAccount class is in the same Ruby source file as the NewBankAccount declaration. If this is not the case, the ''require'' statement must be used to tell Ruby which file to include to find the BankAccount class. Assuming that BankAccount is defined in a file named "BankAccount.rb" we would include the file as follows:
<pre>
require 'BankAccount'
class NewBankAccount < BankAccount
def customerPhone
@customerPhone
end
def customerPhone=( value )
@customerPhone = value
end
end
</pre>