cbeta 3.5.1 → 3.5.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cbeta.rb +44 -6
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0385bf012f175aebe6a653bc3950c5e708a9aa52e0f409e2f45af0283914d4d1'
4
- data.tar.gz: 91c2aad0ca013727c27e3948d5ed507ec34c63a55a8d0e638e99f9eea6b6f1e5
3
+ metadata.gz: 724a67a39ae4c60974ebdb12ef5ae1a8e907abb38628eb670aabf67624e7b82f
4
+ data.tar.gz: 68addb85c98f56d225407d0c231dcea8415b49bd453bcdde0d751d8fbee01745
5
5
  SHA512:
6
- metadata.gz: '03396a41165d5a78b2d8c1bb822473d73a46232ef8985df4bb3aeeb84a2127c9911e598884754c743ab89fddea16414209a2b317eebc8d2406ff64a5f54adb55'
7
- data.tar.gz: 753427466f7c8ae179d02f590de98ae4592b27fe12f0c254c580c702542134b9b9426282278d12f1b25708626e0b337d5c02d7dcec02782c5661b57520d6e73e
6
+ metadata.gz: deb00bf3f2ec8e5257c1defb00830b84da485bc136d88b4d44275978885a8d1851f3a483835dbd52648b75d9d87c840a1464558a419b05c1fdf3b10be7cc541a
7
+ data.tar.gz: fb8bdde0cd8e6cdebd74024fa5cff8ed802678969ebc29a83541ad04e09f5873e251be6fbb165d4d4cd40cc296e07b735785f5cbcfd25331f77a733eee8db667
data/lib/cbeta.rb CHANGED
@@ -56,18 +56,56 @@ class CBETA
56
56
  end
57
57
 
58
58
  # 如果 卷跨冊,回傳 冊號範圍
59
- def self.juan_across_vol(work, juan)
59
+ def self.work_juan_vol_range(work, juan)
60
60
  case work
61
61
  when 'GA0037'
62
- ('GA036'..'GA037') if juan == 2
62
+ (36..37) if juan == 2
63
63
  when 'L1557'
64
64
  case juan
65
- when 17 then ('L130'..'L131')
66
- when 34 then ('L131'..'L132')
67
- when 51 then ('L132'..'L133')
65
+ when 17 then (130..131)
66
+ when 34 then (131..132)
67
+ when 51 then (132..133)
68
68
  end
69
69
  when 'X0714'
70
- ('X39'..'X40') if juan == 3
70
+ (39..40) if juan == 3
71
+ end
72
+ end
73
+
74
+ # 卷跨冊
75
+ # @return [Numeric] 1: 卷跨冊的上半部; 2: 卷跨冊的下半部
76
+ def self.juan_across_vol(vol, work, juan=nil)
77
+ case work
78
+ when 'GA0037'
79
+ case vol
80
+ when 'GA036'
81
+ 1 if juan == 2
82
+ when 'GA037'
83
+ 2 if juan.nil? or juan == 2
84
+ end
85
+ when 'L1557'
86
+ case vol
87
+ when 'L130'
88
+ 1 if juan == 17 # 上半卷
89
+ when 'L131'
90
+ case juan
91
+ when 17, nil then 2
92
+ when 34 then 1
93
+ end
94
+ when 'L132'
95
+ case juan
96
+ when 34, nil then 2
97
+ when 51 then 1
98
+ end
99
+ when 'L133'
100
+ 2 if juan.nil? or juan == 51
101
+ end
102
+ when 'X0714'
103
+ case vol
104
+ when 'X39'
105
+ 1 if juan == 3
106
+ when 'X40'
107
+ 2 if juan.nil? or juan == 3
108
+ end
71
109
  end
72
110
  end
73
111
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cbeta
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.1
4
+ version: 3.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ray Chou