basecustom 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/basecustom.rb +5 -2
- data/lib/basecustom/version.rb +9 -1
- metadata +3 -3
data/lib/basecustom.rb
CHANGED
@@ -8,12 +8,15 @@ require 'basecustom/version'
|
|
8
8
|
class BaseCustom
|
9
9
|
def initialize(array_in)
|
10
10
|
if array_in.is_a?(String)
|
11
|
-
array_in = array_in.split('')
|
11
|
+
array_in = array_in.split('').uniq
|
12
12
|
end
|
13
13
|
if not array_in.is_a?(Array)
|
14
14
|
raise "Invalid type. Please provide a String or an Array."
|
15
15
|
end
|
16
|
-
|
16
|
+
if array_in.any? { |i| not i.is_a?(String) }
|
17
|
+
raise "Invalid type. Each array element must be a string."
|
18
|
+
end
|
19
|
+
@BASE_PRIMITIVES_ARRAY = array_in.flatten.uniq
|
17
20
|
@BASE_PRIMITIVES_HASH = Hash[@BASE_PRIMITIVES_ARRAY.each_with_index.map {|x,idx| [x, idx]}]
|
18
21
|
end # initialize
|
19
22
|
|
data/lib/basecustom/version.rb
CHANGED
@@ -1,3 +1,11 @@
|
|
1
1
|
class BaseCustom
|
2
|
-
VERSION = "0.1.
|
2
|
+
VERSION = "0.1.2"
|
3
3
|
end
|
4
|
+
|
5
|
+
# Version 0.1.2
|
6
|
+
# * Added unique to string init decleration
|
7
|
+
# * Added unique to array as well as all elements are string checking
|
8
|
+
# Version 0.1.1
|
9
|
+
# * Flatten array's on input initialization
|
10
|
+
# Version 0.1.0
|
11
|
+
# * Complete Release
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: basecustom
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 2
|
10
|
+
version: 0.1.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Daniel P. Clark / 6ftDan(TM)
|