kosapi_client 0.6.0 → 0.7.0
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/lib/kosapi_client/api_client.rb +1 -0
- data/lib/kosapi_client/entity.rb +2 -0
- data/lib/kosapi_client/entity/course.rb +8 -1
- data/lib/kosapi_client/entity/coursin.rb +18 -0
- data/lib/kosapi_client/entity/semester.rb +11 -0
- data/lib/kosapi_client/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e1bfb6cc4f38cd06f8fcf6935e5f7d5aabfda7d
|
4
|
+
data.tar.gz: 6ec52f95b8a9ad64b2e48ed8009d3c774b81d7ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d15799f0d38efab036a70c7903cbe082ab90d67e4c7933d7058e05fa64611dc09aed76eddd7d7e972c4f73b5cb855e48e4a624c5e4146fdd04e274e789f229a
|
7
|
+
data.tar.gz: be31ed773ee98c27a2006266b73b64958dc4eeafc38bd7dc1346ab3431b1d19d9af10206e64bda301578e858e464f000b33779b5d90e807efb88a021e5b92175
|
data/lib/kosapi_client/entity.rb
CHANGED
@@ -9,6 +9,7 @@ require 'kosapi_client/entity/base_entity'
|
|
9
9
|
require 'kosapi_client/entity/result_page'
|
10
10
|
require 'kosapi_client/entity/course_event'
|
11
11
|
require 'kosapi_client/entity/course'
|
12
|
+
require 'kosapi_client/entity/coursin'
|
12
13
|
require 'kosapi_client/entity/division'
|
13
14
|
require 'kosapi_client/entity/teacher_timetable_slot'
|
14
15
|
require 'kosapi_client/entity/timetable_slot'
|
@@ -16,5 +17,6 @@ require 'kosapi_client/entity/parallel'
|
|
16
17
|
require 'kosapi_client/entity/base_person'
|
17
18
|
require 'kosapi_client/entity/person'
|
18
19
|
require 'kosapi_client/entity/teacher'
|
20
|
+
require 'kosapi_client/entity/semester'
|
19
21
|
require 'kosapi_client/entity/student'
|
20
22
|
require 'kosapi_client/entity/exam'
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'kosapi_client/entity/coursin'
|
2
|
+
|
1
3
|
module KOSapiClient
|
2
4
|
module Entity
|
3
5
|
class Course < BaseEntity
|
@@ -27,8 +29,13 @@ module KOSapiClient
|
|
27
29
|
map_data :superior_course, Link
|
28
30
|
map_data :subcourses, Link
|
29
31
|
map_data :tutorials_contents, MLString
|
30
|
-
map_data :instance
|
32
|
+
map_data :instances, [Coursin], element: :instance
|
31
33
|
|
34
|
+
def instance(semester_code)
|
35
|
+
instances.find do |coursin|
|
36
|
+
coursin.semester.link_href == "semesters/#{semester_code}/"
|
37
|
+
end
|
38
|
+
end
|
32
39
|
end
|
33
40
|
end
|
34
41
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module KOSapiClient
|
2
|
+
module Entity
|
3
|
+
class Coursin < BaseEntity
|
4
|
+
# TODO: Add capacity
|
5
|
+
|
6
|
+
# XXX: This is really ugly hack! The problem is that "semester" is both
|
7
|
+
# element and attribute, and they are mapped into single Ruby attribute.
|
8
|
+
map_data :semester, Link, element: 1, path: :semester
|
9
|
+
map_data :capacity_overfill, Enum
|
10
|
+
map_data :occupied, Integer
|
11
|
+
map_data :examiners, [Link], element: :teacher, path: :examiners
|
12
|
+
map_data :guarantors, [Link], element: :teacher, path: :guarantors
|
13
|
+
map_data :instructors, [Link], element: :teacher, path: :instructors
|
14
|
+
map_data :lecturers, [Link], element: :teacher, path: :lecturers
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
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.7.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: 2017-12-
|
11
|
+
date: 2017-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -267,6 +267,7 @@ files:
|
|
267
267
|
- lib/kosapi_client/entity/boolean.rb
|
268
268
|
- lib/kosapi_client/entity/course.rb
|
269
269
|
- lib/kosapi_client/entity/course_event.rb
|
270
|
+
- lib/kosapi_client/entity/coursin.rb
|
270
271
|
- lib/kosapi_client/entity/data_mappings.rb
|
271
272
|
- lib/kosapi_client/entity/division.rb
|
272
273
|
- lib/kosapi_client/entity/enum.rb
|
@@ -277,6 +278,7 @@ files:
|
|
277
278
|
- lib/kosapi_client/entity/parallel.rb
|
278
279
|
- lib/kosapi_client/entity/person.rb
|
279
280
|
- lib/kosapi_client/entity/result_page.rb
|
281
|
+
- lib/kosapi_client/entity/semester.rb
|
280
282
|
- lib/kosapi_client/entity/student.rb
|
281
283
|
- lib/kosapi_client/entity/teacher.rb
|
282
284
|
- lib/kosapi_client/entity/teacher_timetable_slot.rb
|