From: misterparker@... Date: 2008-07-16T12:45:18+09:00 Subject: check my class Hey i'm super new at ruby, This is my first class attempt. can i copy and paste this into the prompt? or do i need to save it as a .rb file? or how do i load it? help? haha class Item def initialize(item,price,cost) @price = price @item = item @cost = cost @tax = 0.06 @sales = 0 @salesCount = 0 @salesTaxPayable @remainingCost = cost @revPer = @price-@taxPer @taxPer = @price*@tax @cash = 0 end def sale(discount_price) if discount_price == 0 then @salesTaxPayable = @salesTaxPayable + @taxPer @sales = @sales + @revPer @cash = @cash + @price @remainingCost = @remainingCost - @revPer @saleCount = @saleCount + 1 else @salesTaxPayable = @salesTaxPayable + @taxPer @sales = @sales + (discount_price - (discount_price*@tax)) @cash = @cash + discount_price @remainingCost = @remainingCost - (discount_price - (discount_price*@tax)) @saleCount = @saleCount + 1 end end def cash return @cash end def salesTax return @salesTaxPayable end end