diff options
Diffstat (limited to 'bank-eiffel/retireeaccount.e')
| -rw-r--r-- | bank-eiffel/retireeaccount.e | 37 |
1 files changed, 31 insertions, 6 deletions
diff --git a/bank-eiffel/retireeaccount.e b/bank-eiffel/retireeaccount.e index 3f56fd4..24ae004 100644 --- a/bank-eiffel/retireeaccount.e +++ b/bank-eiffel/retireeaccount.e | |||
| @@ -1,15 +1,40 @@ | |||
| 1 | note | ||
| 2 | description: "Summary description for {RETIREEACCOUNT}." | ||
| 3 | author: "" | ||
| 4 | date: "$Date$" | ||
| 5 | revision: "$Revision$" | ||
| 6 | |||
| 7 | class | 1 | class |
| 8 | RETIREEACCOUNT | 2 | RETIREEACCOUNT |
| 9 | 3 | ||
| 10 | inherit | 4 | inherit |
| 11 | ACCOUNT | 5 | ACCOUNT |
| 6 | redefine | ||
| 7 | add_authorized_signer, | ||
| 8 | set_default_transfer_minamount | ||
| 9 | end | ||
| 10 | |||
| 11 | create | ||
| 12 | make | ||
| 13 | |||
| 14 | feature -- Basic operations | ||
| 15 | |||
| 16 | add_authorized_signer (an_authorized_signer: PERSON) | ||
| 17 | do | ||
| 18 | check | ||
| 19 | authorized_signers_only_one: get_authorized_signers.count = 0 | ||
| 20 | end | ||
| 21 | Precursor (an_authorized_signer) | ||
| 22 | end | ||
| 23 | |||
| 24 | feature {NONE} -- Implementation | ||
| 25 | |||
| 26 | set_default_transfer_minamount | ||
| 27 | do | ||
| 28 | set_transfer_minamount (1.0) | ||
| 29 | end | ||
| 12 | 30 | ||
| 13 | invariant | 31 | invariant |
| 14 | authorized_signers_only_one: authorized_signers.count = 1 | 32 | authorized_signers_only_one: authorized_signers.count = 1 |
| 33 | authorized_signers_attached: authorized_signers.linear_representation /= Void | ||
| 34 | authorized_signers_only_retirees: | ||
| 35 | (attached authorized_signers.linear_representation as signers) implies signers.for_all( | ||
| 36 | agent (person: PERSON): BOOLEAN | ||
| 37 | do | ||
| 38 | Result := attached {RETIREE} person | ||
| 39 | end) | ||
| 15 | end | 40 | end |
