ordrin 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE.txt CHANGED
@@ -1,7 +1,7 @@
1
- Copyright (c) 2012 ordr.in, inc.
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
-
5
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
-
1
+ Copyright (c) 2012 ordr.in, inc.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
7
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -1,95 +1,95 @@
1
- Ordr.in Ruby API
2
- ==================
3
-
4
- A Ruby wrapper for the Restaurant, User, and Order APIs provided by Ordr.in. Everything mentioned here is described in more detail in the documentation in the ruby files. The main API documentation can be found at http://ordr.in/developers.
5
-
6
- The demo script (`bin/ordrindemo.rb`) has examples of calling every function and initializing all of the data structures.
7
-
8
- Data Structures
9
- ---------------
10
-
11
- ```python
12
- Ordrin::Data::Address(addr, city, state, zip, phone, addr2='')
13
-
14
- Ordrin::Data::CreditCard(name, expiry_month, expiry_year, bill_address, number, cvc)
15
-
16
- Ordrin::Data::UserLogin(email, password)
17
-
18
- Ordrin::Data::TrayItem(item_id, quantity, *options)
19
-
20
- Ordrin::Data::Tray(*items)
21
- ```
22
-
23
- Exceptions
24
- ----------
25
-
26
- ```python
27
- Ordrin::Errors::ApiError(msg, text)
28
-
29
- Ordrin::Errors::ApiInvalidResponseError(msg)
30
- ```
31
-
32
- API Initialization
33
- ------------------
34
-
35
- ```python
36
- api = Ordrin::APIs(developer_key, servers, restaurant_url, user_url, order_url)
37
- ```
38
-
39
- Restaurant API Functions
40
- ------------------------
41
- All of these functions are in the `ordrin.restaurant` module.
42
-
43
- ```python
44
- api.restaurant.get_delivery_list(date_time, address)
45
-
46
- api.restaurant.get_delivery_check(retaurant_id, date_time, address)
47
-
48
- api.restaurant.get_fee(restaurant_id, subtotal, tip, date_time, address)
49
-
50
- api.restaurant.get_details(restaurant_id)
51
- ```
52
-
53
- User API Functions
54
- ------------------
55
- All of these functions are in the `ordrin.user` module.
56
-
57
- ```python
58
- api.user.get(login)
59
-
60
- api.user.create(login, first_name, last_name)
61
-
62
- api.user.update(login, first_name, last_name)
63
-
64
- api.user.get_all_addresses(login)
65
-
66
- api.user.get_address(login, addr_nick)
67
-
68
- api.user.set_address(login, addr_nick, address)
69
-
70
- api.user.remove_address(login, addr_nick)
71
-
72
- api.user.get_all_credit_cards(login)
73
-
74
- api.user.get_credit_card(login, card_nick)
75
-
76
- api.user.set_credit_card(login, card_nick, credit_card)
77
-
78
- api.user.remove_credit_card(login, card_nick)
79
-
80
- api.user.get_order_history(login)
81
-
82
- api.user.get_order_detail(login, order_id)
83
-
84
- api.user.set_password(login, new_password)
85
- ```
86
-
87
- Order API Functions
88
- -------------------
89
- All of these functions are in the `ordrin.order` module.
90
-
91
- ```python
92
- api.order.order(restaurant_id, tray, tip, delivery_date_time, first_name, last_name, address, credit_card, email=None, login=None)
93
-
94
- order_create_user(restaurant_id, tray, tip, delivery_date_time, first_name, last_name, address, credit_card, email, password)
1
+ Ordr.in Ruby API
2
+ ==================
3
+
4
+ A Ruby wrapper for the Restaurant, User, and Order APIs provided by Ordr.in. Everything mentioned here is described in more detail in the documentation in the ruby files. The main API documentation can be found at http://ordr.in/developers.
5
+
6
+ The demo script (`bin/ordrindemo.rb`) has examples of calling every function and initializing all of the data structures.
7
+
8
+ Data Structures
9
+ ---------------
10
+
11
+ ```python
12
+ Ordrin::Data::Address(addr, city, state, zip, phone, addr2='')
13
+
14
+ Ordrin::Data::CreditCard(name, expiry_month, expiry_year, bill_address, number, cvc)
15
+
16
+ Ordrin::Data::UserLogin(email, password)
17
+
18
+ Ordrin::Data::TrayItem(item_id, quantity, *options)
19
+
20
+ Ordrin::Data::Tray(*items)
21
+ ```
22
+
23
+ Exceptions
24
+ ----------
25
+
26
+ ```python
27
+ Ordrin::Errors::ApiError(msg, text)
28
+
29
+ Ordrin::Errors::ApiInvalidResponseError(msg)
30
+ ```
31
+
32
+ API Initialization
33
+ ------------------
34
+
35
+ ```python
36
+ api = Ordrin::APIs(developer_key, servers, restaurant_url, user_url, order_url)
37
+ ```
38
+
39
+ Restaurant API Functions
40
+ ------------------------
41
+ All of these functions are in the `ordrin.restaurant` module.
42
+
43
+ ```python
44
+ api.restaurant.get_delivery_list(date_time, address)
45
+
46
+ api.restaurant.get_delivery_check(retaurant_id, date_time, address)
47
+
48
+ api.restaurant.get_fee(restaurant_id, subtotal, tip, date_time, address)
49
+
50
+ api.restaurant.get_details(restaurant_id)
51
+ ```
52
+
53
+ User API Functions
54
+ ------------------
55
+ All of these functions are in the `ordrin.user` module.
56
+
57
+ ```python
58
+ api.user.get(login)
59
+
60
+ api.user.create(login, first_name, last_name)
61
+
62
+ api.user.update(login, first_name, last_name)
63
+
64
+ api.user.get_all_addresses(login)
65
+
66
+ api.user.get_address(login, addr_nick)
67
+
68
+ api.user.set_address(login, addr_nick, address)
69
+
70
+ api.user.remove_address(login, addr_nick)
71
+
72
+ api.user.get_all_credit_cards(login)
73
+
74
+ api.user.get_credit_card(login, card_nick)
75
+
76
+ api.user.set_credit_card(login, card_nick, credit_card)
77
+
78
+ api.user.remove_credit_card(login, card_nick)
79
+
80
+ api.user.get_order_history(login)
81
+
82
+ api.user.get_order_detail(login, order_id)
83
+
84
+ api.user.set_password(login, new_password)
85
+ ```
86
+
87
+ Order API Functions
88
+ -------------------
89
+ All of these functions are in the `ordrin.order` module.
90
+
91
+ ```python
92
+ api.order.order(restaurant_id, tray, tip, delivery_date_time, first_name, last_name, address, credit_card, email=None, login=None)
93
+
94
+ order_create_user(restaurant_id, tray, tip, delivery_date_time, first_name, last_name, address, credit_card, email, password)
95
95
  ```