ruby-skyline-core 0.1.6 → 0.1.7
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/ruby-skyline-core.rb +14 -3
- data/lib/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4a7b558e3a9da1cb3d1c696b642d4f2803d2912
|
4
|
+
data.tar.gz: fe3c5cb527cefa79666dcbe06755a549f07c6665
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d85266d7d3c441a446268204ce969324aa4cda769483288228e0283ba7c3e15d4f202da33934dd40fbee7ae3116b1317ad28567cca9e6d99ed763d39511398cf
|
7
|
+
data.tar.gz: 1544c2c120b1c5a71c2a9ae5121d2ab0be28c41c3f4370dca7cfbf1287b5861fdd0207f1d8c1923ee487368810f42bca3ec345fe08a64153c220b50d858423c9
|
data/lib/ruby-skyline-core.rb
CHANGED
@@ -2,8 +2,7 @@
|
|
2
2
|
class Array
|
3
3
|
# dominate function in skyline for array
|
4
4
|
def dominate?(array)
|
5
|
-
|
6
|
-
raise ArgumentError, 'Two Arrays are not the same size' unless size == array.size
|
5
|
+
pre_check_skyline_domiante(array)
|
7
6
|
flag = 0
|
8
7
|
check_flag = size
|
9
8
|
each_with_index do |attr, index|
|
@@ -18,12 +17,24 @@ class Array
|
|
18
17
|
|
19
18
|
# skyline attributes aggregate for array
|
20
19
|
def aggregate(array)
|
20
|
+
pre_check_skyline_domiante(array)
|
21
21
|
aggregate_array = []
|
22
22
|
raise ArgumentError, "Need Array not #{array.class}" unless array.class == Array
|
23
|
-
raise ArgumentError, 'Two Arrays are not the same size' unless size == array.size
|
24
23
|
each_with_index do |attr, index|
|
25
24
|
aggregate_array << (attr + array[index]).round(6)
|
26
25
|
end
|
27
26
|
aggregate_array
|
28
27
|
end
|
28
|
+
|
29
|
+
# Skyline Error Handling
|
30
|
+
def pre_check_skyline_domiante(target_array)
|
31
|
+
unless target_array.class == Array
|
32
|
+
raise ArgumentError, "excpet (Array) got (#{target_array.class})"
|
33
|
+
end
|
34
|
+
|
35
|
+
unless size == target_array.size
|
36
|
+
raise ArgumentError,
|
37
|
+
"size dosen't match, excpet (#{size}) got (#{target_array.size})"
|
38
|
+
end
|
39
|
+
end
|
29
40
|
end
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-skyline-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- shadow3x3x3
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -92,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
92
92
|
version: '0'
|
93
93
|
requirements: []
|
94
94
|
rubyforge_project:
|
95
|
-
rubygems_version: 2.
|
95
|
+
rubygems_version: 2.5.1
|
96
96
|
signing_key:
|
97
97
|
specification_version: 4
|
98
98
|
summary: Skyline Query Core
|