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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ebd5ae2d91ca6f54c10bcb19d9168a9f9f5c806c
4
- data.tar.gz: 6b7b8d1902c101360bcd8478772daf6c47a5e34f
3
+ metadata.gz: f4a7b558e3a9da1cb3d1c696b642d4f2803d2912
4
+ data.tar.gz: fe3c5cb527cefa79666dcbe06755a549f07c6665
5
5
  SHA512:
6
- metadata.gz: ead957ad0ec4a7f7b56c9fa43fa0a2b35126d97d58237aef633e41c3bb9bec787a7e04bb72914b941730ca0e1bc9e33a107e3bdcfac49f5836278b13b7845e94
7
- data.tar.gz: 80663d78418484b1b87d5c787c7a255ba91953b8072d52f2df34c2efdfcbd936baef9be044839ebac8c2399a5ad509bfd3c321779f77ef761e7da62d5b98b14d
6
+ metadata.gz: d85266d7d3c441a446268204ce969324aa4cda769483288228e0283ba7c3e15d4f202da33934dd40fbee7ae3116b1317ad28567cca9e6d99ed763d39511398cf
7
+ data.tar.gz: 1544c2c120b1c5a71c2a9ae5121d2ab0be28c41c3f4370dca7cfbf1287b5861fdd0207f1d8c1923ee487368810f42bca3ec345fe08a64153c220b50d858423c9
@@ -2,8 +2,7 @@
2
2
  class Array
3
3
  # dominate function in skyline for array
4
4
  def dominate?(array)
5
- raise ArgumentError, "Need Array not #{array.class}" unless array.class == Array
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
@@ -1,3 +1,3 @@
1
1
  module RubySkylineCore
2
- VERSION = '0.1.6'
2
+ VERSION = '0.1.7'
3
3
  end
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.6
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-14 00:00:00.000000000 Z
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.6.4
95
+ rubygems_version: 2.5.1
96
96
  signing_key:
97
97
  specification_version: 4
98
98
  summary: Skyline Query Core