openmenu 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,704 @@
1
+ require "test/unit"
2
+ require "openmenu"
3
+
4
+ class TestOpenMenu< Test::Unit::TestCase
5
+ def setup
6
+ @om = OpenMenu.parse(sample_om)
7
+ end
8
+
9
+ def test_open_menu_parse
10
+ assert_equal "sample", @om.uuid
11
+ assert_equal "2011-08-19", @om.date_created
12
+ assert_equal 1, @om.accuracy
13
+
14
+ assert_equal 1.5, @om.version
15
+
16
+ assert_equal "My Restaurant", @om.restaurant_name
17
+ assert_equal "Brief Description", @om.brief_description
18
+ assert_equal "Full Description", @om.full_description
19
+ assert_equal "independent", @om.business_type
20
+ assert_equal "x123z", @om.location_id
21
+ assert_equal "-81.039833", @om.longitude
22
+ assert_equal "33.999458", @om.latitude
23
+ assert_equal -5.00, @om.utc_offset
24
+ assert_equal "803 Gervais Street", @om.address_1
25
+ assert_equal "STE 2", @om.address_2
26
+ assert_equal "Columbia", @om.city
27
+ assert_equal "Columbia", @om.town
28
+ assert_equal "SC", @om.state
29
+ assert_equal "SC", @om.province
30
+ assert_equal "29202", @om.postal_code
31
+ assert_equal "US", @om.country
32
+
33
+ assert_equal 'Region Name', @om.region_area.name
34
+ assert_equal 'Region Designation', @om.region_area.designation
35
+
36
+ assert_equal "(555) 555-5555", @om.phone
37
+ assert_equal "(555) 888-8888", @om.fax
38
+ assert_equal "http://openmenu.com/", @om.website
39
+ assert_equal "http://openmenu.com/menu/sample", @om.url
40
+
41
+ logo = @om.logos.first
42
+ assert_equal 'http://openmenu.com/images/ico-32-openmenu.png', logo.url
43
+ assert_equal 'Thumbnail', logo.type
44
+ assert_equal 'All', logo.media
45
+ assert_equal 32, logo.height
46
+ assert_equal 32, logo.width
47
+
48
+ # environment
49
+ assert_equal 96, @om.seating_quantity
50
+ assert_equal 12, @om.max_group_size
51
+ assert_equal '0', @om.smoking_allowed
52
+ assert_equal '1', @om.takeout_available
53
+ assert_equal '1', @om.delivery_available
54
+ assert_equal 6.5, @om.delivery.radius
55
+ assert_equal 12.00, @om.delivery.fee
56
+ assert_equal '1', @om.catering_available
57
+ assert_equal 'Suggested', @om.reservations
58
+ assert_equal 'Reservation Online', @om.online_reservations.first.name
59
+ assert_equal 'http://www.on-res.com', @om.online_reservations.first.url
60
+ assert_equal 'web/mobile', @om.online_reservations.first.type
61
+ assert_equal true, @om.online_reservations?
62
+ assert_equal 'Order Online', @om.online_orders.first.name
63
+ assert_equal 'http://www.on-order.com', @om.online_orders.first.url
64
+ assert_equal 'web/mobile', @om.online_orders.first.type
65
+ assert_equal true, @om.online_orders?
66
+ assert_equal 'Live', @om.music_type
67
+ assert_equal 'Full Bar', @om.alcohol_type
68
+ assert_equal '0', @om.pets_allowed
69
+ assert_equal '+55', @om.age_level_preference
70
+ assert_equal '1', @om.wheelchair_accessible
71
+ assert_equal 'casual', @om.dress_code
72
+ assert_equal 'Steakhouse', @om.cuisine_type_primary
73
+ assert_equal 'Seafood', @om.cuisine_type_secondary
74
+ assert_equal 'street_free', @om.parking.street_free
75
+ assert_equal 'street_metered', @om.parking.street_metered
76
+ assert_equal 'private_lot', @om.parking.private_lot
77
+ assert_equal 'garage', @om.parking.garage
78
+ assert_equal 'valet', @om.parking.valet
79
+ assert_equal 'outdoor', @om.seating_locations.first
80
+ assert_equal 'USD', @om.accepted_currencies.first
81
+
82
+ assert_equal 1, @om.operating_days.first.day_of_week
83
+ assert_equal '11:00', @om.operating_days.first.open_time
84
+ assert_equal '22:00', @om.operating_days.first.close_time
85
+ assert_equal 7, @om.operating_days.size
86
+
87
+ contact = @om.contacts.first
88
+ assert_equal 'primary', contact.type
89
+ assert_equal 'Chris', contact.first_name
90
+ assert_equal 'Hanscom', contact.last_name
91
+ assert_equal 'menu@openmenu.com', contact.email
92
+
93
+ parent = @om.parent_company
94
+ assert_equal 'Flintstones Global', parent.name
95
+ assert_equal 'http://flintstones.com', parent.website
96
+ assert_equal '123 Main Street', parent.address_1
97
+ assert_equal 'Suite 1', parent.address_2
98
+ assert_equal 'Bedrock', parent.city
99
+ assert_equal 'Bedrock', parent.town
100
+ assert_equal 'WY', parent.state
101
+ assert_equal 'WY', parent.province
102
+ assert_equal '12345', parent.postal_code
103
+ assert_equal 'USA', parent.country
104
+ assert_equal '(111) 111-1111', parent.phone
105
+ assert_equal '(111) 222-2222', parent.fax
106
+
107
+ assert_equal 2, @om.menus.size
108
+ end
109
+
110
+ def test_menu_parse
111
+ menus = OpenMenu::Menu.parse(sample_om)
112
+ assert_equal 'Main Menu', menus.first.name
113
+ assert_equal 25, menus.first.uid
114
+ assert_equal 'USD', menus.first.currency
115
+ assert_equal 'disabled', menus.first.disabled
116
+ assert_equal true, menus.first.disabled?
117
+
118
+ assert_equal 'lunch-dinner', menus.first.duration.name
119
+ assert_equal '11:00', menus.first.duration.start
120
+ assert_equal '22:00', menus.first.duration.end
121
+
122
+ group = menus.first.groups.first
123
+ assert_equal 'Appetizers', group.name
124
+ assert_equal 2, group.uid
125
+ assert_equal 'disabled', group.disabled
126
+ assert_equal true, group.disabled?
127
+
128
+ option = menus.first.groups[1].options.first
129
+ assert_equal 'Dressings', option.name
130
+ assert_equal 1, option.min_selected
131
+ assert_equal 2, option.max_selected
132
+ assert_equal "Yummy dressings", option.information
133
+
134
+ option_item = option.items.first
135
+ assert_equal 'Italian', option_item.name
136
+ assert_equal 1.00, option_item.additional_cost
137
+
138
+ item = group.items.first
139
+ assert_equal 65, item.uid
140
+ assert_equal 'disabled', item.disabled
141
+ assert_equal true, item.disabled?
142
+ assert_equal 'special', item.special
143
+ assert_equal true, item.special?
144
+ assert_equal 'vegetarian', item.vegetarian
145
+ assert_equal true, item.vegetarian?
146
+ assert_equal 'vegan', item.vegan
147
+ assert_equal true, item.vegan?
148
+ assert_equal 'kosher', item.kosher
149
+ assert_equal true, item.kosher?
150
+ assert_equal 'halal', item.halal
151
+ assert_equal true, item.halal?
152
+ assert_equal 'Coconut Shrimp', item.name
153
+ assert_equal 'Menu Item Description', item.description
154
+ assert_equal 7.95, item.price
155
+ assert_equal 350, item.calories
156
+ assert_equal nil, item.heat_index
157
+ assert_equal 1, group.items[1].heat_index
158
+
159
+ assert_equal 'Contains Seafood', item.allergy.information
160
+ assert_equal 'seafood, coconut', item.allergy.allergens
161
+
162
+ image = item.images.first
163
+ assert_equal 'http://openmenu.com/images/coconut_shrimp.jpg', image.url
164
+ assert_equal 32, image.width
165
+ assert_equal 32, image.height
166
+ assert_equal 'Thumbnail', image.type
167
+ assert_equal 'Web', image.media
168
+
169
+ option = item.options.first
170
+ assert_equal 'Sauce', option.name
171
+ assert_equal 1, option.min_selected
172
+ assert_equal 2, option.max_selected
173
+ assert_equal 'Saucy sauces', option.information
174
+
175
+ option_item = option.items.first
176
+ assert_equal 'Honey', option_item.name
177
+ assert_equal 3.99, option_item.additional_cost
178
+
179
+ tag = item.tags.first
180
+ assert_equal 'prawns', tag
181
+
182
+ size = group.items[2].sizes.first
183
+ assert_equal 'small', size.name
184
+ assert_equal 'Description', size.description
185
+ assert_equal 6.95, size.price
186
+ assert_equal 3000, size.calories
187
+ end
188
+
189
+ def sample_om
190
+ <<-XML
191
+ <omf uuid="sample" date_created="2011-08-19" accuracy="1">
192
+ <openmenu>
193
+ <version>1.5</version>
194
+ <cat>Black</cat>
195
+ <crosswalks>
196
+ <crosswalk>
197
+ <crosswalk_id>31b8bfbf-08a3-478f-a4a4-d3e3143a37fb</crosswalk_id>
198
+ <crosswalk_company>Factual</crosswalk_company>
199
+ <crosswalk_url>
200
+ http://factual.com/31b8bfbf-08a3-478f-a4a4-d3e3143a37fb
201
+ </crosswalk_url>
202
+ </crosswalk>
203
+ </crosswalks>
204
+ </openmenu>
205
+ <restaurant_info>
206
+ <restaurant_name>My Restaurant</restaurant_name>
207
+ <business_type>independent</business_type>
208
+ <brief_description>Brief Description</brief_description>
209
+ <full_description>Full Description</full_description>
210
+ <location_id>x123z</location_id>
211
+ <longitude>-81.039833</longitude>
212
+ <latitude>33.999458</latitude>
213
+ <utc_offset>-5.00</utc_offset>
214
+ <address_1>803 Gervais Street</address_1>
215
+ <address_2>STE 2</address_2>
216
+ <city_town>Columbia</city_town>
217
+ <state_province>SC</state_province>
218
+ <postal_code>29202</postal_code>
219
+ <country>US</country>
220
+ <region_area name="Region Name" designation="Region Designation"/>
221
+ <phone>(555) 555-5555</phone>
222
+ <fax>(555) 888-8888</fax>
223
+ <website_url>http://openmenu.com/</website_url>
224
+ <omf_file_url>http://openmenu.com/menu/sample</omf_file_url>
225
+ <logo_urls>
226
+ <logo_url type="Thumbnail" media="All" height="32" width="32">http://openmenu.com/images/ico-32-openmenu.png</logo_url>
227
+ <logo_url type="Full" media="All">http://openmenu.com/images/sample_logo_full.png</logo_url>
228
+ </logo_urls>
229
+ <environment>
230
+ <seating_qty>96</seating_qty>
231
+ <max_group_size>12</max_group_size>
232
+ <age_level_preference>+55</age_level_preference>
233
+ <smoking_allowed>0</smoking_allowed>
234
+ <takeout_available>1</takeout_available>
235
+ <delivery_available radius="6.5" fee="12.00">1</delivery_available>
236
+ <catering_available>1</catering_available>
237
+ <reservations>Suggested</reservations>
238
+ <alcohol_type>Full Bar</alcohol_type>
239
+ <music_type>Live</music_type>
240
+ <pets_allowed>0</pets_allowed>
241
+ <wheelchair_accessible>1</wheelchair_accessible>
242
+ <dress_code>casual</dress_code>
243
+ <cuisine_type_primary>Steakhouse</cuisine_type_primary>
244
+ <cuisine_type_secondary>Seafood</cuisine_type_secondary>
245
+ <seating_locations>
246
+ <seating_location>outdoor</seating_location>
247
+ <seating_location>indoor</seating_location>
248
+ </seating_locations>
249
+ <accepted_currencies>
250
+ <accepted_currency>USD</accepted_currency>
251
+ </accepted_currencies>
252
+ <online_reservations>
253
+ <online_reservation type="web/mobile">
254
+ <online_reservation_name>Reservation Online</online_reservation_name>
255
+ <online_reservation_url>http://www.on-res.com</online_reservation_url>
256
+ </online_reservation>
257
+ </online_reservations>
258
+ <online_ordering>
259
+ <online_order type="web/mobile">
260
+ <online_order_name>Order Online</online_order_name>
261
+ <online_order_url>http://www.on-order.com</online_order_url>
262
+ </online_order>
263
+ </online_ordering>
264
+ <operating_days>
265
+ <operating_day>
266
+ <day_of_week>1</day_of_week>
267
+ <open_time>11:00</open_time>
268
+ <close_time>22:00</close_time>
269
+ </operating_day>
270
+ <operating_day>
271
+ <day_of_week>2</day_of_week>
272
+ <open_time>11:00</open_time>
273
+ <close_time>22:00</close_time>
274
+ </operating_day>
275
+ <operating_day>
276
+ <day_of_week>3</day_of_week>
277
+ <open_time>11:00</open_time>
278
+ <close_time>22:00</close_time>
279
+ </operating_day>
280
+ <operating_day>
281
+ <day_of_week>4</day_of_week>
282
+ <open_time>11:00</open_time>
283
+ <close_time>22:00</close_time>
284
+ </operating_day>
285
+ <operating_day>
286
+ <day_of_week>5</day_of_week>
287
+ <open_time>11:00</open_time>
288
+ <close_time>22:00</close_time>
289
+ </operating_day>
290
+ <operating_day>
291
+ <day_of_week>6</day_of_week>
292
+ <open_time>11:00</open_time>
293
+ <close_time>22:00</close_time>
294
+ </operating_day>
295
+ <operating_day>
296
+ <day_of_week>7</day_of_week>
297
+ <open_time/>
298
+ <close_time/>
299
+ </operating_day>
300
+ </operating_days>
301
+ <parking street_free="street_free" street_metered="street_metered" private_lot="private_lot" garage="garage" valet="valet"/>
302
+ </environment>
303
+ <contacts>
304
+ <contact type="primary">
305
+ <first_name>Chris</first_name>
306
+ <last_name>Hanscom</last_name>
307
+ <email>menu@openmenu.com</email>
308
+ </contact>
309
+ </contacts>
310
+ <parent_company>
311
+ <parent_company_name>Flintstones Global</parent_company_name>
312
+ <parent_company_website>http://flintstones.com</parent_company_website>
313
+ <address_1>123 Main Street</address_1>
314
+ <address_2>Suite 1</address_2>
315
+ <city_town>Bedrock</city_town>
316
+ <state_province>WY</state_province>
317
+ <postal_code>12345</postal_code>
318
+ <country>USA</country>
319
+ <phone>(111) 111-1111</phone>
320
+ <fax>(111) 222-2222</fax>
321
+ </parent_company>
322
+ </restaurant_info>
323
+ <menus>
324
+ <menu name="Main Menu" currency_symbol="USD" uid="25" disabled="disabled">
325
+ <menu_description/>
326
+ <menu_duration>
327
+ <menu_duration_name>lunch-dinner</menu_duration_name>
328
+ <menu_duration_time_start>11:00</menu_duration_time_start>
329
+ <menu_duration_time_end>22:00</menu_duration_time_end>
330
+ </menu_duration>
331
+ <menu_groups>
332
+ <menu_group name="Appetizers" uid="2" disabled="disabled">
333
+ <menu_group_description/>
334
+ <menu_items>
335
+ <menu_item uid="65" disabled="disabled" special="special" vegetarian="vegetarian" vegan="vegan" kosher="kosher" halal="halal">
336
+ <menu_item_name>Coconut Shrimp</menu_item_name>
337
+ <menu_item_description>Menu Item Description</menu_item_description>
338
+ <menu_item_price>7.95</menu_item_price>
339
+ <menu_item_calories>350</menu_item_calories>
340
+ <menu_item_allergy_information allergens="seafood, coconut">Contains Seafood</menu_item_allergy_information>
341
+ <menu_item_image_urls>
342
+ <menu_item_image_url width="32" height="32" type="Thumbnail" media="Web">http://openmenu.com/images/coconut_shrimp.jpg</menu_item_image_url>
343
+ </menu_item_image_urls>
344
+ <menu_item_options>
345
+ <menu_item_option name="Sauce" min_selected="1" max_selected="2">
346
+ <menu_item_option_information>Saucy sauces</menu_item_option_information>
347
+ <menu_item_option_item>
348
+ <menu_item_option_name>Honey</menu_item_option_name>
349
+ <menu_item_option_additional_cost>3.99</menu_item_option_additional_cost>
350
+ </menu_item_option_item>
351
+ </menu_item_option>
352
+ </menu_item_options>
353
+ <menu_item_tags>
354
+ <menu_item_tag>prawns</menu_item_tag>
355
+ <menu_item_tag>seafood</menu_item_tag>
356
+ </menu_item_tags>
357
+ </menu_item>
358
+ <menu_item>
359
+ <menu_item_name>Tempura Onion Rings</menu_item_name>
360
+ <menu_item_description>With a honey Thai sauce</menu_item_description>
361
+ <menu_item_price>7.95</menu_item_price>
362
+ <menu_item_heat_index>1</menu_item_heat_index>
363
+ </menu_item>
364
+ <menu_item special="special">
365
+ <menu_item_name>Calamari</menu_item_name>
366
+ <menu_item_description>
367
+ Our calamari is lightly fried and tossed with a sweet and spicy Asian mango sauce.
368
+ </menu_item_description>
369
+ <menu_item_price/>
370
+ <menu_item_heat_index>2</menu_item_heat_index>
371
+ <menu_item_sizes>
372
+ <menu_item_size>
373
+ <menu_item_size_name>small</menu_item_size_name>
374
+ <menu_item_size_description>Description</menu_item_size_description>
375
+ <menu_item_size_price>6.95</menu_item_size_price>
376
+ <menu_item_size_calories>3000</menu_item_size_calories>
377
+ </menu_item_size>
378
+ <menu_item_size>
379
+ <menu_item_size_name>large</menu_item_size_name>
380
+ <menu_item_size_description/>
381
+ <menu_item_size_price>8.95</menu_item_size_price>
382
+ </menu_item_size>
383
+ </menu_item_sizes>
384
+ </menu_item>
385
+ </menu_items>
386
+ </menu_group>
387
+ <menu_group name="Salads" uid="3">
388
+ <menu_group_description/>
389
+ <menu_group_options>
390
+ <menu_group_option name="Dressings" min_selected="1" max_selected="2">
391
+ <menu_group_option_information>Yummy dressings</menu_group_option_information>
392
+ <menu_group_option_item>
393
+ <menu_group_option_name>Italian</menu_group_option_name>
394
+ <menu_group_option_additional_cost>1.00</menu_group_option_additional_cost>
395
+ </menu_group_option_item>
396
+ <menu_group_option_item>
397
+ <menu_group_option_name>French</menu_group_option_name>
398
+ <menu_group_option_additional_cost>1.25</menu_group_option_additional_cost>
399
+ </menu_group_option_item>
400
+ <menu_group_option_item>
401
+ <menu_group_option_name>Thousand Island</menu_group_option_name>
402
+ <menu_group_option_additional_cost>1.00</menu_group_option_additional_cost>
403
+ </menu_group_option_item>
404
+ </menu_group_option>
405
+ </menu_group_options>
406
+ <menu_items>
407
+ <menu_item>
408
+ <menu_item_name>Chef Salad</menu_item_name>
409
+ <menu_item_description>Best chef salad in a 20 mile radius</menu_item_description>
410
+ <menu_item_price/>
411
+ <menu_item_sizes>
412
+ <menu_item_size>
413
+ <menu_item_size_name>half</menu_item_size_name>
414
+ <menu_item_size_description/>
415
+ <menu_item_size_price>6.95</menu_item_size_price>
416
+ </menu_item_size>
417
+ <menu_item_size>
418
+ <menu_item_size_name>full</menu_item_size_name>
419
+ <menu_item_size_description/>
420
+ <menu_item_size_price>8.95</menu_item_size_price>
421
+ </menu_item_size>
422
+ </menu_item_sizes>
423
+ </menu_item>
424
+ <menu_item special="special">
425
+ <menu_item_name>Cobb Salad</menu_item_name>
426
+ <menu_item_description>
427
+ Iceberg lettuce topped with turkey, ham, hard cooked eggs, avocado, diced tomatoes, bacon, bleu cheese crumbles and black olives
428
+ </menu_item_description>
429
+ <menu_item_price/>
430
+ <menu_item_sizes>
431
+ <menu_item_size>
432
+ <menu_item_size_name>half</menu_item_size_name>
433
+ <menu_item_size_description/>
434
+ <menu_item_size_price>6.95</menu_item_size_price>
435
+ </menu_item_size>
436
+ <menu_item_size>
437
+ <menu_item_size_name>full</menu_item_size_name>
438
+ <menu_item_size_description/>
439
+ <menu_item_size_price>8.95</menu_item_size_price>
440
+ </menu_item_size>
441
+ </menu_item_sizes>
442
+ </menu_item>
443
+ <menu_item>
444
+ <menu_item_name>Ceasar Salad</menu_item_name>
445
+ <menu_item_description>Fresh romain lettuce with aged parmesan reggiano</menu_item_description>
446
+ <menu_item_price>9.95</menu_item_price>
447
+ </menu_item>
448
+ <menu_item vegetarian="vegetarian">
449
+ <menu_item_name>Garden Salad</menu_item_name>
450
+ <menu_item_description>
451
+ Filled with lettuce, tomatoes, carrots, radishes, cucumbers and shredded cheese
452
+ </menu_item_description>
453
+ <menu_item_price>8.95</menu_item_price>
454
+ </menu_item>
455
+ </menu_items>
456
+ </menu_group>
457
+ <menu_group name="Entrees" uid="1">
458
+ <menu_group_description/>
459
+ <menu_items>
460
+ <menu_item uid="1">
461
+ <menu_item_name>Rack of Lamb</menu_item_name>
462
+ <menu_item_description>Coffee Citrus Crusted Lamb</menu_item_description>
463
+ <menu_item_price>22.95</menu_item_price>
464
+ </menu_item>
465
+ <menu_item uid="2">
466
+ <menu_item_name>Soft Shell Crabs</menu_item_name>
467
+ <menu_item_description>
468
+ Almond encrusted, seasoned and sauteed in butter to a crispy brown
469
+ </menu_item_description>
470
+ <menu_item_price>19.95</menu_item_price>
471
+ <menu_item_allergy_information allergens="shellfish, nuts">Reference allergens for allergy information</menu_item_allergy_information>
472
+ </menu_item>
473
+ <menu_item uid="3" special="special">
474
+ <menu_item_name>Cioppino</menu_item_name>
475
+ <menu_item_description>
476
+ Fresh fish, scallops, mussels, calamari, and shrimp in a tomato-garlic saffron broth over linguini
477
+ </menu_item_description>
478
+ <menu_item_price>24.95</menu_item_price>
479
+ </menu_item>
480
+ </menu_items>
481
+ </menu_group>
482
+ </menu_groups>
483
+ </menu>
484
+ <menu name="Late Night Menu" currency_symbol="USD" uid="35">
485
+ <menu_description/>
486
+ <menu_duration>
487
+ <menu_duration_name>late-night</menu_duration_name>
488
+ <menu_duration_time_start>20:00</menu_duration_time_start>
489
+ <menu_duration_time_end>23:00</menu_duration_time_end>
490
+ </menu_duration>
491
+ <menu_groups>
492
+ <menu_group name="Bar Food" uid="1">
493
+ <menu_group_description/>
494
+ <menu_items>
495
+ <menu_item>
496
+ <menu_item_name>Cheese Sticks</menu_item_name>
497
+ <menu_item_description>Cheese sticks with marinara sauce</menu_item_description>
498
+ <menu_item_price>6.95</menu_item_price>
499
+ </menu_item>
500
+ <menu_item>
501
+ <menu_item_name>Coconut Shrimp</menu_item_name>
502
+ <menu_item_description>Crispy Coconut Shrimp</menu_item_description>
503
+ <menu_item_price>7.95</menu_item_price>
504
+ <menu_item_calories>350</menu_item_calories>
505
+ </menu_item>
506
+ <menu_item>
507
+ <menu_item_name>Tempura Onion Rings</menu_item_name>
508
+ <menu_item_description>With a honey Thai sauce</menu_item_description>
509
+ <menu_item_price>7.95</menu_item_price>
510
+ </menu_item>
511
+ <menu_item>
512
+ <menu_item_name>Calamari</menu_item_name>
513
+ <menu_item_description>
514
+ Our calamari is lightly fried and tossed with a sweet and spicy Asian mango sauce.
515
+ </menu_item_description>
516
+ <menu_item_price>8.85</menu_item_price>
517
+ </menu_item>
518
+ </menu_items>
519
+ </menu_group>
520
+ </menu_groups>
521
+ </menu>
522
+ </menus>
523
+ </omf>
524
+ XML
525
+ end
526
+ def example_om
527
+ <<-XML
528
+ <omf uuid="1111-2222" date_created="2011-08-19" accuracy="500">
529
+ <openmenu>
530
+ <version>1.5</version>
531
+ <crosswalks>
532
+ <crosswalk>
533
+ <crosswalk_id>Crosswalk ID</crosswalk_id>
534
+ <crosswalk_company>Crosswalk Company</crosswalk_company>
535
+ <crosswalk_url>Crosswalk URL</crosswalk_url>
536
+ </crosswalk>
537
+ </crosswalks>
538
+ </openmenu>
539
+
540
+ <restaurant_info>
541
+ <restaurant_name>Restaurant Name</restaurant_name>
542
+ <brief_description>Brief Description</brief_description>
543
+ <full_description>Full Description</full_description>
544
+ <business_type>independent</business_type>
545
+ <location_id>x123z</location_id>
546
+ <logo_urls>
547
+ <logo_url width="Width" height="Height" type="Type" media="Media">Logo URL</logo_url>
548
+ </logo_urls>
549
+ <address_1>Address 1</address_1>
550
+ <address_2>Address 2</address_2>
551
+ <city_town>City Town</city_town>
552
+ <region_area name="Name" designation="Designation"/>
553
+ <state_province>State Providence</state_province>
554
+ <postal_code>Postal Code</postal_code>
555
+ <country>Country</country>
556
+ <phone>Phone</phone>
557
+ <fax>Fax</fax>
558
+ <longitude>-81.039833</longitude>
559
+ <latitude>33.999458</latitude>
560
+ <utc_offset>UTC Offset</utc_offset>
561
+ <website_url>Website URL</website_url>
562
+ <omf_file_url>OMF URL</omf_file_url>
563
+ <environment>
564
+ <seating_qty>Seating QTY</seating_qty>
565
+ <smoking_allowed></smoking_allowed>
566
+ <max_group_size></max_group_size>
567
+ <pets_allowed></pets_allowed>
568
+ <age_level_preference></age_level_preference>
569
+ <dress_code></dress_code>
570
+ <cuisine_type_primary></cuisine_type_primary>
571
+ <cuisine_type_secondary></cuisine_type_secondary>
572
+ <takeout_available></takeout_available>
573
+ <delivery_available radius="" fee=""></delivery_available>
574
+ <catering_available></catering_available>
575
+ <wheelchair_accessible></wheelchair_accessible>
576
+ <reservations></reservations>
577
+ <alcohol_type></alcohol_type>
578
+ <music_type></music_type>
579
+ <parking street_free="" street_metered="" private_lot="" garage="" valet=""></parking>
580
+ <seating_locations>
581
+ <seating_location></seating_location>
582
+ </seating_locations>
583
+ <accepted_currencies>
584
+ <accepted_currency></accepted_currency>
585
+ </accepted_currencies>
586
+ <online_reservations>
587
+ <online_reservation type="">
588
+ <online_reservation_name></online_reservation_name>
589
+ <online_reservation_url></online_reservation_url>
590
+ </online_reservation>
591
+ </online_reservations>
592
+ <online_ordering>
593
+ <online_order type="">
594
+ <online_order_name></online_order_name>
595
+ <online_order_url></online_order_url>
596
+ </online_order>
597
+ </online_ordering>
598
+ <operating_days>
599
+ <operating_day>
600
+ <day_of_week></day_of_week>
601
+ <open_time></open_time>
602
+ <close_time></close_time>
603
+ </operating_day>
604
+ </operating_days>
605
+ </environment>
606
+ <parent_company>
607
+ <parent_company_name></parent_company_name>
608
+ <parent_company_website></parent_company_website>
609
+ <address_1></address_1>
610
+ <address_2></address_2>
611
+ <city_town></city_town>
612
+ <state_province></state_province>
613
+ <postal_code></postal_code>
614
+ <country></country>
615
+ <phone></phone>
616
+ <fax></fax>
617
+ </parent_company>
618
+ <contacts>
619
+ <contact type="">
620
+ <first_name></first_name>
621
+ <last_name></last_name>
622
+ <email></email>
623
+ </contact>
624
+ </contacts>
625
+ </restaurant_info>
626
+
627
+ <menus>
628
+ <menu name="Menu Name" uid="UID" currency_symbol="Currency" disabled="">
629
+ <menu_description>Description</menu_description>
630
+ <menu_duration>
631
+ <menu_duration_name>Duration Name</menu_duration_name>
632
+ <menu_duration_time_start>Start</menu_duration_time_start>
633
+ <menu_duration_time_end>End</menu_duration_time_end>
634
+ </menu_duration>
635
+ <menu_groups>
636
+ <menu_group name="Group Name" uid="UID" disabled="">
637
+ <menu_group_description>Description</menu_group_description>
638
+ <menu_group_options>
639
+ <menu_group_option name="Group Option Name" min_selected="Min" max_selected="Max">
640
+ <menu_group_option_information>Group Option Information</menu_group_option_information>
641
+ <menu_group_option_item>
642
+ <menu_group_option_name>Option Item Name</menu_group_option_name>
643
+ <menu_group_option_additional_cost>Option Item Cost</menu_group_option_additional_cost>
644
+ </menu_group_option_item>
645
+ <menu_group_option_item>
646
+ <menu_group_option_name>Option Item Name 2</menu_group_option_name>
647
+ <menu_group_option_additional_cost>Option Item Cost 2</menu_group_option_additional_cost>
648
+ </menu_group_option_item>
649
+ </menu_group_option>
650
+ </menu_group_options>
651
+ <menu_items>
652
+ <menu_item uid="UID" disabled="" special="Special" vegetarian="Vegetarian" vegan="Vegan" kosher="Kosher" halal="Halal">
653
+ <menu_item_name>Menu Item Name</menu_item_name>
654
+ <menu_item_description>Menu Item Description</menu_item_description>
655
+ <menu_item_image_urls>
656
+ <menu_item_image_url width="Width" height="Height" type="Type" media="Media">Menu Item Image URL</menu_item_image_url>
657
+ </menu_item_image_urls>
658
+ <menu_item_price>Price</menu_item_price>
659
+ <menu_item_calories>Calories</menu_item_calories>
660
+ <menu_item_heat_index>Heat Index</menu_item_heat_index>
661
+ <menu_item_allergy_information allergens="cat, duck">Don't eat this if you hate cats.</menu_item_allergy_information>
662
+ <menu_item_sizes>
663
+ <menu_item_size>
664
+ <menu_item_size_name>Small</menu_item_size_name>
665
+ <menu_item_size_description>Smallest</menu_item_size_description>
666
+ <menu_item_size_price>10.00</menu_item_size_price>
667
+ <menu_item_size_calories>10000</menu_item_size_calories>
668
+ </menu_item_size>
669
+ <menu_item_size>
670
+ <menu_item_size_name>Large</menu_item_size_name>
671
+ <menu_item_size_description>Largest</menu_item_size_description>
672
+ <menu_item_size_price>20.00</menu_item_size_price>
673
+ <menu_item_size_calories>20000</menu_item_size_calories>
674
+ </menu_item_size>
675
+ </menu_item_sizes>
676
+ <menu_item_options>
677
+ <menu_item_option name="Menu Item Option Name" min_selected="Min" max_selected="Max">
678
+ <menu_item_option_information>Item Option Information</menu_item_option_information>
679
+ <menu_item_option_item>
680
+ <menu_item_option_name>Item Option Name</menu_item_option_name>
681
+ <menu_item_option_additional_cost>Item Additonal Cost</menu_item_option_additional_cost>
682
+ </menu_item_option_item>
683
+ </menu_item_option>
684
+ </menu_item_options>
685
+ <menu_item_tags>
686
+ <menu_item_tag>Item Tag</menu_item_tag>
687
+ </menu_item_tags>
688
+ </menu_item>
689
+ </menu_items>
690
+ </menu_group>
691
+ </menu_groups>
692
+ </menu>
693
+ <menu name="Menu Name" uid="UID" currency_symbol="Currency" disabled="disabled">
694
+ <menu_duration>
695
+ <menu_duration_name>Duration Name</menu_duration_name>
696
+ <menu_duration_time_start>Start</menu_duration_time_start>
697
+ <menu_duration_time_end>End</menu_duration_time_end>
698
+ </menu_duration>
699
+ </menu>
700
+ </menus>
701
+ </omf>
702
+ XML
703
+ end
704
+ end