// Apple's Currency Converter example in Objective Modula-2
//
// Converter.def -- Converter model interface
//
// http://objective.modula2.net/samples/Converter.def

DEFINITION MODULE Converter;

FROM Cocoa IMPORT *; <*FRAMEWORK*>

(* Class declaration *)

TYPE
    Converter = CLASS ( NSObject )
        sourceCurrencyAmount,
        rate : REAL;
    END; (* CLASS *)

(* accessor and mutator for sourceCurrencyAmount *)

METHOD (self : Converter) sourceCurrencyAmount : REAL;

METHOD (self : Converter) setSourceCurrencyAmount: (newAmount : REAL);

(* accessor and mutator for rate *)

METHOD (self : Converter) rate : REAL;

METHOD (self : Converter) setRate: (newRate : REAL);

(* conversion method *)

METHOD (self : Converter) convertCurrency : REAL;

END Converter.