kosapi_client 0.6.0 → 0.7.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: f487f91043e5b0941cceb0848db870e7c21d4f22
4
- data.tar.gz: 2ebfc29ba496aed0cd7d103332bbfba30ea266f3
3
+ metadata.gz: 6e1bfb6cc4f38cd06f8fcf6935e5f7d5aabfda7d
4
+ data.tar.gz: 6ec52f95b8a9ad64b2e48ed8009d3c774b81d7ec
5
5
  SHA512:
6
- metadata.gz: 9783ca343bf7b53992dc66c6fb7e9a355cd849f60f03142181d14c7cc6c5df2d75895889e162b2c2ab717824b5bb2f8808bc32d50d763fa60b302d17a58be59f
7
- data.tar.gz: d313ba2e37f42be9ec83cb8fdc0bd59b5f32c08072383911662dc333bef366ab91a39dc62f3b6b7f4f9e9cd2a9fafa9316a2a427e986831ff8f896d3015ddc7f
6
+ metadata.gz: 1d15799f0d38efab036a70c7903cbe082ab90d67e4c7933d7058e05fa64611dc09aed76eddd7d7e972c4f73b5cb855e48e4a624c5e4146fdd04e274e789f229a
7
+ data.tar.gz: be31ed773ee98c27a2006266b73b64958dc4eeafc38bd7dc1346ab3431b1d19d9af10206e64bda301578e858e464f000b33779b5d90e807efb88a021e5b92175
@@ -11,6 +11,7 @@ module KOSapiClient
11
11
  resource :divisions
12
12
  resource :parallels
13
13
  resource :exams
14
+ resource :semesters
14
15
  resource :teachers
15
16
 
16
17
  attr_reader :http_client
@@ -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 #todo
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
@@ -0,0 +1,11 @@
1
+ module KOSapiClient
2
+ module Entity
3
+ class Semester < BaseEntity
4
+
5
+ map_data :code
6
+ map_data :end_date, Time
7
+ map_data :name, MLString
8
+ map_data :start_date, Time
9
+ end
10
+ end
11
+ end
@@ -1,3 +1,3 @@
1
1
  module KOSapiClient
2
- VERSION = '0.6.0'
2
+ VERSION = '0.7.0'
3
3
  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.6.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-02 00:00:00.000000000 Z
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