eddy 0.8.3 → 0.8.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/eddy/data.rb +0 -11
- data/lib/eddy/data/persistence/base.rb +0 -13
- data/lib/eddy/data/persistence/memory.rb +0 -18
- data/lib/eddy/models/functional_group.rb +3 -2
- data/lib/eddy/models/interchange.rb +5 -1
- data/lib/eddy/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a32819aa478f947399641cb8457f5a06e4a81d86f89881567da6857df815f5b
|
4
|
+
data.tar.gz: 1e46e09711b93f043e0374e9d651f2f7498f18e87f13aaefd0e022be920668b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f8f16313bca74dcd860787f2e94d349c1609e450d7efe0b6ebca76e4fa779d283477f282415f45f94fd55c304e2023ae554cdc0e8e371672466df82a95f0a7b
|
7
|
+
data.tar.gz: 78e1996a735712303f6605124c002612d94f31e546fa5ee77f11510f4da3b41733cf313cdc9791e9737ef2119907316b8b4b58ac8c8c9ddefb811c605f3a2fd7
|
data/CHANGELOG.md
CHANGED
@@ -13,6 +13,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
13
13
|
|
14
14
|
## master (unreleased)
|
15
15
|
|
16
|
+
## 0.8.4 (2020-01-15)
|
17
|
+
|
18
|
+
### Changed
|
19
|
+
|
20
|
+
- Updated logic for generating functional group control numbers.
|
21
|
+
|
16
22
|
## 0.8.3 (2020-01-15)
|
17
23
|
|
18
24
|
### Changed
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
[travis-ci]: https://travis-ci.org/tcd/eddy
|
11
11
|
[coveralls]: https://coveralls.io/github/tcd/eddy?branch=master
|
12
12
|
[license]: https://github.com/tcd/eddy/blob/master/LICENSE.txt
|
13
|
-
[docs]: https://www.rubydoc.info/gems/eddy/0.8.
|
13
|
+
[docs]: https://www.rubydoc.info/gems/eddy/0.8.4
|
14
14
|
|
15
15
|
## Installation
|
16
16
|
|
data/lib/eddy/data.rb
CHANGED
@@ -54,16 +54,5 @@ module Eddy
|
|
54
54
|
return new_ctrl_num
|
55
55
|
end
|
56
56
|
|
57
|
-
# Return a new, unique number.
|
58
|
-
#
|
59
|
-
# @param functional_group [String]
|
60
|
-
# @return [Integer]
|
61
|
-
def self.new_functional_group_control_number(functional_group)
|
62
|
-
existing = Eddy.data.functional_group_control_numbers(functional_group)
|
63
|
-
new_ctrl_num = Eddy::Util.new_number(existing)
|
64
|
-
Eddy.data.add_functional_group_control_number(functional_group, new_ctrl_num)
|
65
|
-
return new_ctrl_num
|
66
|
-
end
|
67
|
-
|
68
57
|
end
|
69
58
|
end
|
@@ -9,12 +9,6 @@ module Eddy
|
|
9
9
|
raise NotImplementedError
|
10
10
|
end
|
11
11
|
|
12
|
-
# @param _functional_group [String]
|
13
|
-
# @return [Array<Integer>]
|
14
|
-
def functional_group_control_numbers(_functional_group)
|
15
|
-
raise NotImplementedError
|
16
|
-
end
|
17
|
-
|
18
12
|
# @param _transaction_set_id [String]
|
19
13
|
# @return [Array<Integer>]
|
20
14
|
def transaction_set_control_numbers(_transaction_set_id)
|
@@ -27,13 +21,6 @@ module Eddy
|
|
27
21
|
raise NotImplementedError
|
28
22
|
end
|
29
23
|
|
30
|
-
# @param _functional_group [String]
|
31
|
-
# @param _new_ctrl_num [Integer]
|
32
|
-
# @return [Array<Integer>]
|
33
|
-
def add_functional_group_control_number(_functional_group, _new_ctrl_num)
|
34
|
-
raise NotImplementedError
|
35
|
-
end
|
36
|
-
|
37
24
|
# @param _transaction_set_id [String]
|
38
25
|
# @param _new_ctrl_num [Integer]
|
39
26
|
# @return [Array<Integer>]
|
@@ -8,7 +8,6 @@ module Eddy
|
|
8
8
|
def initialize()
|
9
9
|
@data = {
|
10
10
|
interchange_control_numbers: [],
|
11
|
-
functional_group_control_numbers: {},
|
12
11
|
transaction_set_control_numbers: {},
|
13
12
|
}
|
14
13
|
end
|
@@ -18,15 +17,6 @@ module Eddy
|
|
18
17
|
return @data[:interchange_control_numbers]
|
19
18
|
end
|
20
19
|
|
21
|
-
# @param functional_group [String]
|
22
|
-
# @return [Array<Integer>]
|
23
|
-
def functional_group_control_numbers(functional_group)
|
24
|
-
unless @data[:functional_group_control_numbers].key?(functional_group)
|
25
|
-
@data[:functional_group_control_numbers][functional_group] = []
|
26
|
-
end
|
27
|
-
return @data[:functional_group_control_numbers][functional_group]
|
28
|
-
end
|
29
|
-
|
30
20
|
# @param transaction_set_id [String]
|
31
21
|
# @return [Array<Integer>]
|
32
22
|
def transaction_set_control_numbers(transaction_set_id)
|
@@ -43,14 +33,6 @@ module Eddy
|
|
43
33
|
return nil
|
44
34
|
end
|
45
35
|
|
46
|
-
# @param functional_group [String]
|
47
|
-
# @param new_ctrl_num [Integer]
|
48
|
-
# @return [void]
|
49
|
-
def add_functional_group_control_number(functional_group, new_ctrl_num)
|
50
|
-
self.functional_group_control_numbers(functional_group).append(new_ctrl_num)
|
51
|
-
return nil
|
52
|
-
end
|
53
|
-
|
54
36
|
# @param transaction_set_id [String]
|
55
37
|
# @param new_ctrl_num [Integer]
|
56
38
|
# @return [void]
|
@@ -16,17 +16,18 @@ module Eddy
|
|
16
16
|
attr_accessor :transaction_sets
|
17
17
|
|
18
18
|
# @param store [Eddy::Data::Store]
|
19
|
+
# @param control_number [Integer]
|
19
20
|
# @param transaction_sets [Eddy::Models::TransactionSet]
|
20
21
|
# @return [void]
|
21
|
-
def initialize(store, *transaction_sets)
|
22
|
+
def initialize(store, control_number, *transaction_sets)
|
22
23
|
self.store = store
|
24
|
+
self.control_number = control_number
|
23
25
|
transaction_sets.flatten!
|
24
26
|
self.transaction_sets = transaction_sets || []
|
25
27
|
if self.transaction_sets.length == 0
|
26
28
|
raise ArgumentError, "At least one transaction set is required to create a functional group"
|
27
29
|
end
|
28
30
|
@id = self.transaction_sets.first.functional_group
|
29
|
-
self.control_number = Eddy::Data.new_functional_group_control_number(@id)
|
30
31
|
end
|
31
32
|
|
32
33
|
# @return [Array<#render>]
|
@@ -44,7 +44,11 @@ module Eddy
|
|
44
44
|
sorted_sets[ts.functional_group] ||= []
|
45
45
|
sorted_sets[ts.functional_group] << ts
|
46
46
|
end
|
47
|
-
|
47
|
+
i = 0
|
48
|
+
return sorted_sets.map do |_, value|
|
49
|
+
i += 1
|
50
|
+
Eddy::Models::FunctionalGroup.new(self.store, i, *value)
|
51
|
+
end
|
48
52
|
end
|
49
53
|
|
50
54
|
private
|
data/lib/eddy/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eddy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Clay Dunston
|
@@ -1569,7 +1569,7 @@ metadata:
|
|
1569
1569
|
homepage_uri: https://github.com/tcd/eddy
|
1570
1570
|
source_code_uri: https://github.com/tcd/eddy
|
1571
1571
|
changelog_uri: https://github.com/tcd/eddy/blob/master/CHANGELOG.md
|
1572
|
-
documentation_uri: https://www.rubydoc.info/gems/eddy/0.8.
|
1572
|
+
documentation_uri: https://www.rubydoc.info/gems/eddy/0.8.4
|
1573
1573
|
yard.run: yri
|
1574
1574
|
post_install_message:
|
1575
1575
|
rdoc_options: []
|