four-pillars 0.1.8 → 0.1.9
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/four-pillars.rb +9 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6661078196b447ada01fff77f6318bd22dbf5820412e7ba3f62b5fa1f5c53fd1
|
4
|
+
data.tar.gz: 975caa949f0bfbe47b3d2b170b92f6eb64fcae50928d7be21099b4b55793a35a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bdbc3dd26e68999d5a933ddf1895eda9ccf7bce7676a59b6e31ef6b16131d0d76ddb2aee56b24bd081cd25f6e55e926e762508047b56dbba0aed1074cb157fcc
|
7
|
+
data.tar.gz: 2f6e174e5bad2dc1669404b89f9eb2329f74ba926498b4a0bf56b8da4ac48678f1e5b22660023ff542053d0b8b7317402df8a0a9978e58b54c27daa2b93d6a29
|
data/lib/four-pillars.rb
CHANGED
@@ -86,8 +86,7 @@ class FourPillarsLogic
|
|
86
86
|
|
87
87
|
# 通変星
|
88
88
|
def self.tsuhensei(j_day,j_src) # 日柱の十干、月柱または年柱の十干
|
89
|
-
|
90
|
-
if j % 2 == 0 # 陽
|
89
|
+
if plus_jikkan?(j_day) # 陽
|
91
90
|
jikkan = JIKKAN
|
92
91
|
else # 陰
|
93
92
|
jikkan = JIKKAN_IN
|
@@ -109,10 +108,15 @@ class FourPillarsLogic
|
|
109
108
|
JYUNIUNSEI[(ji + offset) % 12]
|
110
109
|
end
|
111
110
|
|
112
|
-
#
|
111
|
+
# 十干の陰陽 陽:true 陰:false
|
112
|
+
def self.plus_jikkan?(jikkan)
|
113
|
+
i = JIKKAN.index(jikkan)
|
114
|
+
raise "Invalid jikkan: #{jikkan}" if i.nil?
|
115
|
+
return i % 2 == 0
|
116
|
+
end
|
113
117
|
|
114
118
|
# 生年月日時間, 性別(大運の向きに使用)
|
115
|
-
attr_reader :birth_dt
|
119
|
+
attr_reader :birth_dt, :gender
|
116
120
|
|
117
121
|
def initialize(birth_dt,gender)
|
118
122
|
@birth_dt = birth_dt.map {|v| v.to_i }
|
@@ -292,6 +296,7 @@ class FourPillarsLogic
|
|
292
296
|
[d,m,y]
|
293
297
|
end
|
294
298
|
|
299
|
+
# 十二運星エネルギー
|
295
300
|
def jyuniunsei_energy
|
296
301
|
jyuniunsei.map {|v| JYUNIUNSEI_ENERGY[v] }
|
297
302
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: four-pillars
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yosei Ito
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A class which tells fortune by Four Pillar astrology(四柱推命).
|
14
14
|
email: y-itou@lumber-mill.co.jp
|
@@ -37,7 +37,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
37
37
|
- !ruby/object:Gem::Version
|
38
38
|
version: '0'
|
39
39
|
requirements: []
|
40
|
-
rubygems_version: 3.
|
40
|
+
rubygems_version: 3.3.7
|
41
41
|
signing_key:
|
42
42
|
specification_version: 4
|
43
43
|
summary: Four Pillar astrology
|