This repository has been archived by the owner on Jul 9, 2022. It is now read-only.
/
api_v2.rb
99 lines (85 loc) · 2.18 KB
/
api_v2.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
module OpenMensa
module Resources
module APIv2
def self.headers(status, head = {})
css_class = (status == 204 || status == 404) ? 'headers no-response' : 'headers'
lines = ["Status: #{STATUSES[status]}"]
head.each do |key, value|
lines << "#{key}: #{value}"
end
%(<pre class="#{css_class}"><code>#{lines * "\n"}</code></pre>\n)
end
def self.sidebar_identifier
'sidebar_v2'
end
COORDINATES = [
52.1396188273019,
11.6475999355316
]
MEAL = {
"id" => 260,
"name" => "Gemüse-Couscouspfanne mit Joghurt-Ingwer-Dip, dazu bunter Blattsalat",
"notes" => [
"ovo-lacto-vegetabil",
"mensaVital"
],
"prices" => {
"student" => 2.30,
"employee" => 3.65,
"other" => 4.60
},
"category" => "Alternativ-Angebot"
}
MEAL2 = {
"id" => 10900,
"name" => "Hähnchenschnitzel mit Brötchen",
"notes" => [],
"prices" => {
"pupil" => 2.40,
"other" => 4.30,
},
"category" => "Cafeteria Heiße Theke"
}
MEALS = [MEAL, MEAL2]
DAY = {
"id" => 23,
"date" => "2012-05-29T00:00:00Z",
"closed" => false,
"meal_ids" => [260, 10900]
}
DAY2 = {
"id" => 24,
"date" => "2012-05-30T00:00:00Z",
"closed" => true
}
DAYS = [DAY, DAY2]
CANTEEN = {
"id" => 1,
"name" => "Mensa UniCampus Magdeburg",
"address" => "Pfälzer Str. 1, 39106 Magdeburg",
"coordinates" => COORDINATES
}
CANTEEN2 = {
"id" => 104,
"name" => "Bistro Tasty Studio Babelsberg",
"address" => "August-Bebel-Str. 26-53, 14482 Potsdam, Deutschland",
"coordinates" => [
52.3877669669544,
13.1209909915924
]
}
CANTEENS = [CANTEEN, CANTEEN2]
FAV = {
"id" => 55,
"canteen_id" => 1,
"sort_value" => 4
}
FAV2 = {
"id" => 56,
"canteen_id" => 2,
"sort_value" => 6
}
FAVS = [FAV, FAV2]
end
end
end