luca-jp 0.14.1 → 0.14.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/luca/jp/version.rb +1 -1
- data/lib/luca_salary/jp/insurance.rb +11 -7
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51503b8d2c4e5ff7ec98bead91c34a6972d73a54c145249252f42bbdc9f4bcfe
|
4
|
+
data.tar.gz: 61741745b41a9ebea245c6c3dbde8dd27d9b5d5eaa74b1836d7cb449088453ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78168441bdb7700c6359e8e80ee492baa32516ec975b01c67515c318e1c588a478bfac2418f9d78170effd4b14545234645965fe258790c9da12e076232210cc
|
7
|
+
data.tar.gz: 8077bf6ea387c86108e5ef44f66e405853bc7047037aea1feded14f5cc83ef4c292caab495eb2cc811d5539ac4901f949404c37473ac698a0408a03da3a322de
|
data/lib/luca/jp/version.rb
CHANGED
@@ -1,22 +1,26 @@
|
|
1
1
|
require 'bigdecimal'
|
2
2
|
require 'date'
|
3
3
|
require 'json'
|
4
|
+
require 'luca_record'
|
4
5
|
require 'pathname'
|
5
6
|
|
6
|
-
class InsuranceJP
|
7
|
+
class InsuranceJP < LucaRecord::Base
|
7
8
|
attr_reader :table
|
9
|
+
@record_type = 'json'
|
10
|
+
@dirname = 'dict'
|
8
11
|
|
9
12
|
# load config
|
10
13
|
def initialize(dir_path, area=nil, date=nil)
|
11
|
-
@pjdir = Pathname(dir_path)
|
14
|
+
@pjdir = Pathname(dir_path)
|
12
15
|
@area = area
|
13
16
|
@date = date
|
14
|
-
|
17
|
+
filename = select_active_filename
|
18
|
+
@table = self.class.load_table(@pjdir, filename)
|
15
19
|
end
|
16
20
|
|
17
|
-
def load_table
|
18
|
-
|
19
|
-
|
21
|
+
def self.load_table(pjdir, filename)
|
22
|
+
file_path = pjdir / @dirname / filename
|
23
|
+
load_data(File.open(file_path))
|
20
24
|
end
|
21
25
|
|
22
26
|
def health_insurance_salary(rank)
|
@@ -61,7 +65,7 @@ class InsuranceJP
|
|
61
65
|
|
62
66
|
# TODO: Limit only to pension tables.
|
63
67
|
def open_tables
|
64
|
-
Dir.chdir(@pjdir.to_s) do
|
68
|
+
Dir.chdir((@pjdir / 'dict').to_s) do
|
65
69
|
Dir.glob("*.json").each do |file_name|
|
66
70
|
File.open(file_name, 'r') {|f| yield(f, file_name)}
|
67
71
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: luca-jp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.14.
|
4
|
+
version: 0.14.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chuma Takahiro
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 0.1.26
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: lucarecord
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.5.5
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.5.5
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: jp-national-tax
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|