VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
END
Attribute VB_Name = "clsLoanShark"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
' ActiveX: Guide to the Perplexed
' Copyright (c) 1997 by Desaware Inc.  All Rights Reserved
' Chapter 5

Option Explicit

' Implements the clsBankLoan interface
Implements clsBankLoan

' Internal class object used in aggregation
Private LoanTemplate As New clsBankLoan




Public Function LatePenalty() As String
   Select Case LoanTemplate.AmountAvailable
      Case 0 To 25000
         LatePenalty = "Broken Fingers"
      Case 25000 To 75000
         LatePenalty = "Broken arm"
      Case Else
         LatePenalty = "You don't want to know"
   End Select
End Function

Private Property Let clsBankLoan_AmountAvailable(ByVal RHS As Currency)
   LoanTemplate.AmountAvailable = RHS
End Property

Private Property Get clsBankLoan_AmountAvailable() As Currency
   clsBankLoan_AmountAvailable = LoanTemplate.AmountAvailable
End Property

Private Property Let clsBankLoan_Duration(ByVal RHS As Integer)
   LoanTemplate.Duration = RHS
End Property

Private Property Get clsBankLoan_Duration() As Integer
   clsBankLoan_Duration = LoanTemplate.Duration
End Property

Private Property Let clsBankLoan_Interest(ByVal RHS As Double)
   If RHS < 0.5 Then RHS = RHS + 0.5
   LoanTemplate.Interest = RHS
End Property

Private Property Get clsBankLoan_Interest() As Double
   clsBankLoan_Interest = LoanTemplate.Interest
End Property

' Get reference to other interface
Private Function clsBankLoan_MainInterface() As Object
   Dim myobj As clsLoanShark
   Set myobj = Me    ' Get correct interface
   Set clsBankLoan_MainInterface = myobj
End Function

Private Function clsBankLoan_Payment() As Currency
   clsBankLoan_Payment = LoanTemplate.Payment
End Function

Private Function clsBankLoan_SourceType() As String
   clsBankLoan_SourceType = "Loan Shark"
End Function

Private Function clsBankLoan_Summary() As String
   clsBankLoan_Summary = LoanTemplate.Summary
End Function
