Updated, improved and cleaned RESTbucks example.

Moved it under "rest" subfolder.
This commit is contained in:
2017-02-13 16:23:38 +01:00
parent a44c4d9a16
commit b56aec67a9
35 changed files with 1826 additions and 1419 deletions

View File

@@ -0,0 +1,61 @@
note
description: "Summary description for {SHARED_RESTBUCKS_API}."
date: "$Date$"
revision: "$Revision$"
class
SHARED_RESTBUCKS_API
feature -- Access: bridget to api
has_order (a_id: READABLE_STRING_GENERAL): BOOLEAN
do
Result := api.has_order (a_id)
end
order (a_id: READABLE_STRING_GENERAL): detachable ORDER
do
Result := api.order (a_id)
end
feature -- Element change
submit_order (a_order: ORDER)
-- Submit new order `a_order`.
require
no_id: not a_order.has_id
do
api.submit_order (a_order)
ensure
a_order.has_id
a_order.is_submitted
end
update_order (a_order: ORDER)
-- Update the order to the repository
require
a_order.has_id
do
api.save_order (a_order)
ensure
a_order_with_id: a_order.has_id
end
delete_order (a_order: ORDER)
require
a_order_with_id: a_order.has_id
do
api.delete_order (a_order)
end
feature -- Access
api: RESTBUCKS_API
once
create Result.make
end
note
copyright: "2011-2017, Javier Velilla and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
end