encoded_id 1.0.0.rc1 → 1.0.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -0
- data/Gemfile +1 -1
- data/lib/encoded_id/alphabet.rb +8 -4
- data/lib/encoded_id/version.rb +1 -1
- data/sig/encoded_id.rbs +3 -0
- 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: d7e11278f039a19d4fa201541b907a3f52e5b73c440ba0870c6e8a4fd068bb99
|
4
|
+
data.tar.gz: 70d726b45f982670895c1ddccbbf7e9f42b4a6ab3e6eca8439ac5e58ce399fe0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fcfad8b207316c8041ddd6cd8687a17b9e04c5bcdca8b73084aae2e4a241c5b2c10247fe24f513e66d939ab97289bb1206458f0fab70cc6a04415224ec62083b
|
7
|
+
data.tar.gz: c3d4148b9ddddac5eb2dc47b58c2beb6e88e0e3be9c207328e36c825adbce05826c3eaeb6b4d2023160da65286c177e3a3085f222ba7ba7eb529dab995939cb3
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/lib/encoded_id/alphabet.rb
CHANGED
@@ -19,15 +19,19 @@ module EncodedId
|
|
19
19
|
|
20
20
|
def initialize(characters, equivalences = nil)
|
21
21
|
raise_invalid_alphabet! unless valid_input_characters?(characters)
|
22
|
-
unique_characters = unique_character_alphabet(characters)
|
23
|
-
raise_character_set_too_small! unless sufficient_characters?(unique_characters.size)
|
24
|
-
raise_invalid_equivalences! unless valid_equivalences?(equivalences, unique_characters)
|
22
|
+
@unique_characters = unique_character_alphabet(characters)
|
23
|
+
raise_character_set_too_small! unless sufficient_characters?(@unique_characters.size)
|
24
|
+
raise_invalid_equivalences! unless valid_equivalences?(equivalences, @unique_characters)
|
25
25
|
|
26
26
|
@characters = unique_characters.join
|
27
27
|
@equivalences = equivalences
|
28
28
|
end
|
29
29
|
|
30
|
-
attr_reader :characters, :equivalences
|
30
|
+
attr_reader :unique_characters, :characters, :equivalences
|
31
|
+
|
32
|
+
def include?(character)
|
33
|
+
unique_characters.include?(character)
|
34
|
+
end
|
31
35
|
|
32
36
|
private
|
33
37
|
|
data/lib/encoded_id/version.rb
CHANGED
data/sig/encoded_id.rbs
CHANGED
@@ -11,9 +11,12 @@ module EncodedId
|
|
11
11
|
|
12
12
|
def initialize: (String, ?::Hash[::String, ::String]) -> void
|
13
13
|
|
14
|
+
attr_reader unique_characters: ::Array[::String]
|
14
15
|
attr_reader characters: String
|
15
16
|
attr_reader equivalences: ::Hash[::String, ::String]
|
16
17
|
|
18
|
+
def include?: (::String character) -> bool
|
19
|
+
|
17
20
|
def self.modified_crockford: () -> Alphabet
|
18
21
|
|
19
22
|
private
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: encoded_id
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.rc2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen Ierodiaconou
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-08-
|
11
|
+
date: 2023-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hashids
|