meibo 0.14.0 → 0.15.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
  SHA256:
3
- metadata.gz: 5ad0dc346f3bc9d8166c4ddc9a55ddfedc79bcf78aea61f83289e339a40dfea4
4
- data.tar.gz: d2bf911450a3c05d334e3b6c5ea7ea9a2dd8e9cb141ce125f0d6a95a99e4daca
3
+ metadata.gz: 0f093d7946a8add1449f8ae9c89c94a47431f36386c598dfeb21ca225ca9c167
4
+ data.tar.gz: facfe3ab95a9e3c4f61885afedea7df1c8f657725f4e61b6918da4e58f0375ec
5
5
  SHA512:
6
- metadata.gz: fb78b3143e372d6629f174fe3e0d34eea05ecbaf11bb1b8c0478c09a6a78c9792349f850da3f7530f5e20e5503b5151907dd6e7ee85a46dc286f5bc1f24cbc71
7
- data.tar.gz: d28830dba3e605a95bca895ddc2655d6921707884c0fefa5257e79766e400f13bcc7e9c47a940c8687f4a874a2e8d4178ef61aef721cd7bcd16e784d4aeac2ab
6
+ metadata.gz: c472f7f3874f886ae4c27b9fb93b8a8024f820b1a6172b04b54efcfcaca5672faca6d1235845d9bad8daf63fa9a277714140ee9114ca537ced93e584a6c45d55
7
+ data.tar.gz: 0220f2730b1ee389f13e7c114a87964a82a7777e3c1662963c04977f74a9bfa85b0c5afbacd2701a483aef3c9ba6f30c1f4be8d6722081334288b4d5bb590864
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- meibo (0.14.0)
4
+ meibo (0.15.0)
5
5
  rubyzip
6
6
  zeitwerk
7
7
 
@@ -45,6 +45,10 @@ module Meibo
45
45
  @extension_fields = extension_fields
46
46
  end
47
47
 
48
+ def collection
49
+ Meibo.current_roster.academic_sessions
50
+ end
51
+
48
52
  def grading_period?
49
53
  type == TYPES[:grading_period]
50
54
  end
@@ -62,11 +66,11 @@ module Meibo
62
66
  end
63
67
 
64
68
  def parent
65
- parent_sourced_id && Meibo.current_roster.academic_sessions.find(parent_sourced_id)
69
+ parent_sourced_id && collection.find(parent_sourced_id)
66
70
  end
67
71
 
68
72
  def children
69
- Meibo.current_roster.academic_sessions.where(parent_sourced_id: sourced_id)
73
+ collection.where(parent_sourced_id: sourced_id)
70
74
  end
71
75
  end
72
76
  end
@@ -64,6 +64,10 @@ module Meibo
64
64
  @extension_fields = extension_fields
65
65
  end
66
66
 
67
+ def collection
68
+ Meibo.current_roster.classes
69
+ end
70
+
67
71
  def homeroom?
68
72
  class_type == TYPES[:homeroom]
69
73
  end
data/lib/meibo/course.rb CHANGED
@@ -42,6 +42,10 @@ module Meibo
42
42
  @extension_fields = extension_fields
43
43
  end
44
44
 
45
+ def collection
46
+ Meibo.current_roster.courses
47
+ end
48
+
45
49
  def organization
46
50
  Meibo.current_roster.organizations.find(org_sourced_id)
47
51
  end
@@ -61,6 +61,10 @@ module Meibo
61
61
  klass.define_singleton_method(:write_converters) { write_converter }
62
62
  end
63
63
 
64
+ def lineno
65
+ collection.lineno(self)
66
+ end
67
+
64
68
  def to_csv(...)
65
69
  to_a.to_csv(...)
66
70
  end
@@ -42,6 +42,11 @@ module Meibo
42
42
  raise DataNotFoundError, "sourcedId: #{sourced_id} が見つかりません"
43
43
  end
44
44
 
45
+ def lineno(datum)
46
+ # NOTE: add one for one-based, and add one for header line
47
+ find_index(datum)&.+(2)
48
+ end
49
+
45
50
  def where(**conditions)
46
51
  group_cache[conditions.keys.sort][conditions.values]
47
52
  end
@@ -67,6 +67,10 @@ module Meibo
67
67
  @extension_fields = extension_fields
68
68
  end
69
69
 
70
+ def collection
71
+ Meibo.current_roster.demographics
72
+ end
73
+
70
74
  def male?
71
75
  sex == SEX[:male]
72
76
  end
@@ -46,6 +46,10 @@ module Meibo
46
46
  @extension_fields = extension_fields
47
47
  end
48
48
 
49
+ def collection
50
+ Meibo.current_roster.enrollments
51
+ end
52
+
49
53
  def administrator?
50
54
  role == ROLES[:administrator]
51
55
  end
@@ -41,6 +41,10 @@ module Meibo
41
41
  @extension_fields = extension_fields
42
42
  end
43
43
 
44
+ def collection
45
+ Meibo.current_roster.organizations
46
+ end
47
+
44
48
  def department?
45
49
  type == TYPES[:department]
46
50
  end
@@ -66,7 +70,11 @@ module Meibo
66
70
  end
67
71
 
68
72
  def parent
69
- parent_sourced_id && Meibo.current_roster.organizations.find(parent_sourced_id)
73
+ parent_sourced_id && collection.find(parent_sourced_id)
74
+ end
75
+
76
+ def children
77
+ collection.where(parent_sourced_id: sourced_id)
70
78
  end
71
79
 
72
80
  def enrollments
data/lib/meibo/role.rb CHANGED
@@ -62,6 +62,10 @@ module Meibo
62
62
  @extension_fields = extension_fields
63
63
  end
64
64
 
65
+ def collection
66
+ Meibo.current_roster.roles
67
+ end
68
+
65
69
  def primary?
66
70
  @role_type == TYPES[:primary]
67
71
  end
data/lib/meibo/user.rb CHANGED
@@ -68,6 +68,10 @@ module Meibo
68
68
  @extension_fields = extension_fields
69
69
  end
70
70
 
71
+ def collection
72
+ Meibo.current_roster.users
73
+ end
74
+
71
75
  def agents
72
76
  agent_sourced_ids.map {|agent_sourced_id| Meibo.current_roster.users.find(agent_sourced_id) }
73
77
  end
@@ -39,6 +39,10 @@ module Meibo
39
39
  @extension_fields = extension_fields
40
40
  end
41
41
 
42
+ def collection
43
+ Meibo.current_roster.user_profiles
44
+ end
45
+
42
46
  def user
43
47
  Meibo.current_roster.users.find(user_sourced_id)
44
48
  end
data/lib/meibo/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Meibo
4
- VERSION = "0.14.0"
4
+ VERSION = "0.15.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: meibo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seiei Miyagi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-11-16 00:00:00.000000000 Z
11
+ date: 2022-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip
@@ -125,7 +125,7 @@ metadata:
125
125
  allowed_push_host: https://rubygems.org/
126
126
  homepage_uri: https://github.com/hanachin/meibo
127
127
  source_code_uri: https://github.com/hanachin/meibo
128
- changelog_uri: https://github.com/hanachin/meibo/blob/meibo/v0.14.0/CHANGELOG.md
128
+ changelog_uri: https://github.com/hanachin/meibo/blob/meibo/v0.15.0/CHANGELOG.md
129
129
  post_install_message:
130
130
  rdoc_options: []
131
131
  require_paths: