kosapi_client 0.7.1 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2cbd06f389e0118e1f7c3e9366af9638ee643bbf
|
4
|
+
data.tar.gz: b4c7f3e7680653e4920a2c30876107c2dbf1ce2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dee4adbe8a2bdd0f8a975aaeb7797cdf61cc0230540b66666f8e30bf973b64d9ce919ab3d030981f45b8ce67fc5e590dd6252cdd24c74b44c7de36ba1f0c4d8b
|
7
|
+
data.tar.gz: 8f327d32b45559da7156b0ca039fffbb73e64bb77e366f59574d9fe8cdcc8ce7a8e748f12e25f1004e83d62fb0c50438e81b5ff66fc098a94a5f3ea34fcd6c53
|
data/lib/kosapi_client/entity.rb
CHANGED
@@ -14,6 +14,7 @@ require 'kosapi_client/entity/division'
|
|
14
14
|
require 'kosapi_client/entity/teacher_timetable_slot'
|
15
15
|
require 'kosapi_client/entity/timetable_slot'
|
16
16
|
require 'kosapi_client/entity/parallel'
|
17
|
+
require 'kosapi_client/entity/parameter'
|
17
18
|
require 'kosapi_client/entity/base_person'
|
18
19
|
require 'kosapi_client/entity/person'
|
19
20
|
require 'kosapi_client/entity/teacher'
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module KOSapiClient
|
2
|
+
module Entity
|
3
|
+
class Parameter < BaseEntity
|
4
|
+
|
5
|
+
map_data :description, String
|
6
|
+
map_data :key, String
|
7
|
+
map_data :value, String
|
8
|
+
end
|
9
|
+
|
10
|
+
# XSI type of the Parameter entity is actually KoSetting (wtf?), thus we
|
11
|
+
# must define this alias so ResponseConverter can find the entity class.
|
12
|
+
KoSetting = Parameter
|
13
|
+
end
|
14
|
+
end
|
@@ -32,6 +32,26 @@ module KOSapiClient
|
|
32
32
|
|
33
33
|
alias where query
|
34
34
|
|
35
|
+
# Specify order of the results.
|
36
|
+
#
|
37
|
+
# Examples:
|
38
|
+
# .order_by(:firstName, :lastName)
|
39
|
+
# .order_by(:firstName, lastName: :desc)
|
40
|
+
# .order_by(firstName: :asc, lastName: desc)
|
41
|
+
def order_by(*args, **kwargs)
|
42
|
+
ordering = args + kwargs.map do |attr, dir|
|
43
|
+
if dir != :asc && dir != :desc
|
44
|
+
raise ArgumentError, "Direction must be :asc, or :desc, but got #{dir.inspect}"
|
45
|
+
end
|
46
|
+
"#{attr}@#{dir}"
|
47
|
+
end
|
48
|
+
|
49
|
+
@url_builder.set_query_param(:orderBy, ordering.join(','))
|
50
|
+
self
|
51
|
+
end
|
52
|
+
|
53
|
+
alias order order_by
|
54
|
+
|
35
55
|
def initialize(resource_name, http_client, url_builder = URLBuilder.new(resource_name.to_s))
|
36
56
|
@base_url = resource_name
|
37
57
|
@http_client = http_client
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kosapi_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tibor Szolár
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -276,6 +276,7 @@ files:
|
|
276
276
|
- lib/kosapi_client/entity/link.rb
|
277
277
|
- lib/kosapi_client/entity/ml_string.rb
|
278
278
|
- lib/kosapi_client/entity/parallel.rb
|
279
|
+
- lib/kosapi_client/entity/parameter.rb
|
279
280
|
- lib/kosapi_client/entity/person.rb
|
280
281
|
- lib/kosapi_client/entity/result_page.rb
|
281
282
|
- lib/kosapi_client/entity/semester.rb
|