lws 0.4.2 → 6.1.0.beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.rdoc +4 -2
- data/bin/lwsconsole +32 -35
- data/lib/lws/auth.rb +425 -152
- data/lib/lws/corporate_website.rb +186 -68
- data/lib/lws/digital_signage.rb +1796 -0
- data/lib/lws/generic.rb +46 -50
- data/lib/lws/maps.rb +84 -38
- data/lib/lws/presence.rb +93 -73
- data/lib/lws/stubbing.rb +2 -2
- data/lib/lws/ticket.rb +230 -177
- data/lib/lws/version.rb +2 -2
- data/lib/lws.rb +66 -25
- data/lws.gemspec +3 -2
- data/test/api_token_middleware_test.rb +4 -4
- data/test/auth_test.rb +95 -8
- data/test/corporate_website_test.rb +44 -2
- data/test/digital_signage_test.rb +829 -0
- data/test/fixtures/auth.yml +4 -1
- data/test/fixtures/permissions.yml +0 -4
- data/test/generic_test.rb +0 -17
- data/test/json_parser_test.rb +57 -0
- data/test/logger_test.rb +2 -1
- data/test/maps_test.rb +22 -1
- data/test/presence_test.rb +18 -18
- data/test/setup_test.rb +5 -0
- data/test/stubbing_test.rb +4 -2
- data/test/test_helper.rb +3 -2
- data/test/ticket_test.rb +59 -44
- metadata +43 -24
@@ -20,7 +20,7 @@ module LWS::CorporateWebsite
|
|
20
20
|
end
|
21
21
|
# :nocov:
|
22
22
|
|
23
|
-
|
23
|
+
# @!visibility private
|
24
24
|
def self.api
|
25
25
|
LWS.setup_api(LWS.config.endpoints[:corporate_website] ||
|
26
26
|
ENDPOINT[LWS.config.environment])
|
@@ -33,113 +33,231 @@ module LWS::CorporateWebsite
|
|
33
33
|
use_api LWS::CorporateWebsite.api
|
34
34
|
end
|
35
35
|
|
36
|
-
# (see Generic::Task)
|
37
|
-
class Task < LWS::Generic::Task
|
38
|
-
use_api LWS::CorporateWebsite.api
|
39
|
-
end
|
40
|
-
|
41
36
|
### App specific classes
|
42
37
|
|
43
38
|
# = The article class
|
44
39
|
class Article < LWS::Generic::Model
|
45
40
|
use_api LWS::CorporateWebsite.api
|
46
41
|
|
47
|
-
|
48
|
-
#
|
42
|
+
# @!attribute id [r]
|
43
|
+
# @return [Fixnum] the (unique) ID of the article
|
44
|
+
attribute :id
|
45
|
+
|
46
|
+
# @!attribute body
|
47
|
+
# @return [String, nil] the body of the article
|
48
|
+
attribute :body
|
49
49
|
|
50
|
-
|
51
|
-
#
|
50
|
+
# @!attribute key
|
51
|
+
# @return [String] the (page) key of the article
|
52
|
+
attribute :key
|
52
53
|
|
53
|
-
|
54
|
-
#
|
55
|
-
|
56
|
-
#@!attribute language
|
57
|
-
# @return [String] the ID of the language of the article (2 character)
|
54
|
+
# @!attribute language
|
55
|
+
# @return [String] the ID of the language of the article (2 character)
|
56
|
+
attribute :language
|
58
57
|
|
59
|
-
|
60
|
-
#
|
58
|
+
# @!attribute layout
|
59
|
+
# @return ["text_image_social", "text_only", "map"] the layout used for
|
60
|
+
# the article
|
61
|
+
attribute :layout
|
61
62
|
|
62
|
-
|
63
|
-
#
|
63
|
+
# @!attribute menu_key
|
64
|
+
# @return [String, nil] the key of menu the article belongs to
|
65
|
+
attribute :menu_key
|
64
66
|
|
65
|
-
|
66
|
-
#
|
67
|
+
# @!attribute menu_item
|
68
|
+
# @return [Boolean] whether the article has a menu item
|
69
|
+
attribute :menu_item
|
67
70
|
|
68
|
-
|
69
|
-
#
|
71
|
+
# @!attribute news
|
72
|
+
# @return [Boolean, nil] flag whether the article is a news article
|
73
|
+
attribute :news
|
70
74
|
|
71
|
-
|
72
|
-
#
|
75
|
+
# @!attribute order
|
76
|
+
# @return [Fixnum, nil] the order (number) of the article withing the page
|
77
|
+
attribute :order
|
73
78
|
|
74
|
-
|
75
|
-
#
|
79
|
+
# @!attribute picture
|
80
|
+
# @return [String, nil] the path to the picture accompanying the article
|
81
|
+
attribute :picture
|
76
82
|
|
77
|
-
|
78
|
-
#
|
83
|
+
# @!attribute picture_caption
|
84
|
+
# @return [String, nil] the caption for the picture accompanying the article
|
85
|
+
attribute :picture_caption
|
79
86
|
|
80
|
-
|
81
|
-
#
|
87
|
+
# @!attribute picture_url
|
88
|
+
# @return [String, nil] the URL to the picture accompanying the article
|
89
|
+
attribute :picture_url
|
82
90
|
|
83
|
-
|
84
|
-
#
|
91
|
+
# @!attribute sitemap
|
92
|
+
# @return [Boolean] flag whether the article is included in the sitemap
|
93
|
+
attribute :sitemap
|
85
94
|
|
86
|
-
|
87
|
-
#
|
95
|
+
# @!attribute social_avatar
|
96
|
+
# @return [String, nil] the path to the social avatar accompanying the article
|
97
|
+
attribute :social_avatar
|
88
98
|
|
89
|
-
|
90
|
-
#
|
99
|
+
# @!attribute social_avatar_url
|
100
|
+
# @return [String, nil] the URL to the social avatar accompanying the article
|
101
|
+
attribute :social_avatar_url
|
91
102
|
|
92
|
-
|
93
|
-
#
|
103
|
+
# @!attribute social_location
|
104
|
+
# @return [String, nil] the location of the social user accompanying the article
|
105
|
+
attribute :social_location
|
94
106
|
|
95
|
-
|
96
|
-
#
|
107
|
+
# @!attribute social_name
|
108
|
+
# @return [String, nil] the name of the social user accompanying the article
|
109
|
+
attribute :social_name
|
97
110
|
|
98
|
-
|
99
|
-
#
|
111
|
+
# @!attribute social_text
|
112
|
+
# @return [String, nil] the text of the social user accompanying the article
|
113
|
+
attribute :social_text
|
100
114
|
|
101
|
-
|
102
|
-
#
|
115
|
+
# @!attribute title
|
116
|
+
# @return [String, nil] the title of the article
|
117
|
+
attribute :title
|
103
118
|
|
104
|
-
|
105
|
-
#
|
119
|
+
# @!attribute url
|
120
|
+
# @return [String] the (partial) URL of the article
|
121
|
+
attribute :url
|
106
122
|
|
107
|
-
|
123
|
+
# @!attribute created_at [r]
|
124
|
+
# @return [String] the timestamp of when the article was created
|
125
|
+
attribute :created_at
|
126
|
+
|
127
|
+
# @!attribute updated_at [r]
|
128
|
+
# @return [String] the timestamp of when the article was last updated
|
129
|
+
attribute :updated_at
|
108
130
|
end
|
109
131
|
|
110
132
|
# = The opening hours class
|
111
133
|
class OfficeTime < LWS::Generic::Model
|
112
134
|
use_api LWS::CorporateWebsite.api
|
113
135
|
|
114
|
-
|
115
|
-
#
|
136
|
+
# @!attribute id [r]
|
137
|
+
# @return [Fixnum] the (unique) ID of the office time
|
138
|
+
attribute :id
|
139
|
+
|
140
|
+
# @!attribute announce
|
141
|
+
# @return [String, nil] the date/time when the special office times
|
142
|
+
# need to be announced on
|
143
|
+
attribute :announce
|
144
|
+
|
145
|
+
# @!attribute display_text
|
146
|
+
# @return [String] the displayed text of the special office time
|
147
|
+
attribute :display_text
|
148
|
+
|
149
|
+
# @!attribute end
|
150
|
+
# @return [String] the end date/time of the special office times
|
151
|
+
attribute :end
|
116
152
|
|
117
|
-
|
118
|
-
#
|
119
|
-
|
153
|
+
# @!attribute language
|
154
|
+
# @return [String] the ID of the language the office time is for (2 characters)
|
155
|
+
attribute :language
|
156
|
+
|
157
|
+
# @!attribute motive
|
158
|
+
# @return [String] the special office time motive/key
|
159
|
+
attribute :motive
|
160
|
+
|
161
|
+
# @!attribute start
|
162
|
+
# @return [String] the start date/time of the special office times
|
163
|
+
attribute :start
|
164
|
+
|
165
|
+
# @!attribute created_at [r]
|
166
|
+
# @return [String] the timestamp of when the office time was created
|
167
|
+
attribute :created_at
|
168
|
+
|
169
|
+
# @!attribute updated_at [r]
|
170
|
+
# @return [String] the timestamp of when the office time was last updated
|
171
|
+
attribute :updated_at
|
172
|
+
end
|
173
|
+
|
174
|
+
# = The social page class
|
175
|
+
class SocialPage < LWS::Generic::Model
|
176
|
+
use_api LWS::CorporateWebsite.api
|
120
177
|
|
121
|
-
|
122
|
-
#
|
178
|
+
# @!attribute id [r]
|
179
|
+
# @return [Fixnum] the (unique) ID of the social page
|
180
|
+
attribute :id
|
123
181
|
|
124
|
-
|
125
|
-
#
|
182
|
+
# @!attribute account
|
183
|
+
# @return [LWS::Auth::Account] the account used for posting the social page
|
184
|
+
belongs_to :account, class_name: "LWS::Auth::Account"
|
126
185
|
|
127
|
-
|
128
|
-
#
|
186
|
+
# @!attribute account_id
|
187
|
+
# @return [Fixnum] the ID of the account used for posting the social page
|
188
|
+
attribute :account_id
|
129
189
|
|
130
|
-
|
131
|
-
#
|
190
|
+
# @!attribute company
|
191
|
+
# @return [LWS::Auth::Company] the account used for posting the social page
|
192
|
+
belongs_to :company, class_name: "LWS::Auth::Company"
|
132
193
|
|
133
|
-
|
134
|
-
#
|
194
|
+
# @!attribute company_id
|
195
|
+
# @return [Fixnum] the ID of the account used for posting the social page
|
196
|
+
attribute :company_id
|
135
197
|
|
136
|
-
|
137
|
-
#
|
198
|
+
# @!attribute provider
|
199
|
+
# @return ["facebook", "linkedin", "twitter", nil] the social page provider
|
200
|
+
attribute :provider
|
138
201
|
|
139
|
-
|
140
|
-
#
|
202
|
+
# @!attribute provider_uid
|
203
|
+
# @return [String] the UID suplied by the social page provider
|
204
|
+
attribute :provider_uid
|
141
205
|
|
142
|
-
|
206
|
+
# @!attribute uid_type
|
207
|
+
# @return ["personal", "page"] the social page UID type
|
208
|
+
attribute :uid_type
|
209
|
+
|
210
|
+
# @!attribute created_at [r]
|
211
|
+
# @return [String] the timestamp of when the social page was created
|
212
|
+
attribute :created_at
|
213
|
+
|
214
|
+
# @!attribute updated_at [r]
|
215
|
+
# @return [String] the timestamp of when the social page was last updated
|
216
|
+
attribute :updated_at
|
143
217
|
end
|
144
218
|
|
219
|
+
# = The social post class
|
220
|
+
class SocialPost < LWS::Generic::Model
|
221
|
+
use_api LWS::CorporateWebsite.api
|
222
|
+
|
223
|
+
# @!attribute id [r]
|
224
|
+
# @return [Fixnum] the (unique) ID of the social post
|
225
|
+
attribute :id
|
226
|
+
|
227
|
+
# @!attribute article
|
228
|
+
# @return [Article] the article associated with the social post
|
229
|
+
belongs_to :article
|
230
|
+
|
231
|
+
# @!attribute article_id
|
232
|
+
# @return [Fixnum] the ID of the article associated with the social post
|
233
|
+
attribute :article_id
|
234
|
+
|
235
|
+
# @!attribute description
|
236
|
+
# @return [String] the description of the social post
|
237
|
+
attribute :description
|
238
|
+
|
239
|
+
# @!attribute link
|
240
|
+
# @return [String, nil] the link used in the social post
|
241
|
+
attribute :link
|
242
|
+
|
243
|
+
# @!attribute lat
|
244
|
+
# @return [Float, nil] the latitude of the location of the social post
|
245
|
+
attribute :lat
|
246
|
+
|
247
|
+
# @!attribute long
|
248
|
+
# @return [Float, nil] the longitude of the location of the social post
|
249
|
+
attribute :long
|
250
|
+
|
251
|
+
# @!attribute title
|
252
|
+
# @return [String] the title of the social post
|
253
|
+
attribute :title
|
254
|
+
|
255
|
+
# @!attribute created_at [r]
|
256
|
+
# @return [String] the timestamp of when the social post was created
|
257
|
+
attribute :created_at
|
258
|
+
|
259
|
+
# @!attribute updated_at [r]
|
260
|
+
# @return [String] the timestamp of when the social post was last updated
|
261
|
+
attribute :updated_at
|
262
|
+
end
|
145
263
|
end
|