PageRenderTime 205ms CodeModel.GetById 202ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/examples/restbuck_server/src/domain/item_constants.e

http://github.com/jocelyn/EiffelWebReloaded
Specman e | 51 lines | 39 code | 6 blank | 6 comment | 1 complexity | 1d674bb3d2c7ddf170612cbb19b317a9 MD5 | raw file
 1note
 2	description: "Summary description for {ITEM_CONSTANTS}."
 3	author: ""
 4	date: "$Date$"
 5	revision: "$Revision$"
 6
 7class
 8	ITEM_CONSTANTS
 9feature -- Access
10	is_valid_coffee_type (a_type: STRING) : BOOLEAN
11		--is `a_type' a valid coffee type
12		do
13			a_type.to_lower
14			coffe_types.compare_objects
15			Result := coffe_types.has (a_type)
16		end
17
18    Coffe_types : ARRAY[STRING]
19		-- List of valid Coffee types
20		once
21			Result := <<"late","cappuccino", "expresso">>
22		end
23
24	is_valid_milk_type (a_type: STRING) : BOOLEAN
25		--is `a_type' a valid milk type
26		do
27			a_type.to_lower
28			milk_types.compare_objects
29			Result := milk_types.has (a_type)
30		end
31
32	Milk_types : ARRAY[STRING]
33		-- List of valid Milk types
34		once
35			Result := <<"skim","semi", "whole">>
36		end
37
38	is_valid_size_option (an_option: STRING) : BOOLEAN
39		--is `an_option' a valid size option
40		do
41			an_option.to_lower
42			size_options.compare_objects
43			Result := size_options.has (an_option)
44		end
45
46	Size_options :	ARRAY[STRING]
47		-- List of valid Size_options
48		once
49			Result := <<"small","mediumn", "large">>
50		end
51end