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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a860b12577a70042f6d17a1788cb8557f3ab5ab477441a44c3be037b70165ded
4
- data.tar.gz: bd9d57c92ada9e47a1080ea5b4d04cb3069a055a213305b698f1a2c7c424297f
3
+ metadata.gz: d7e11278f039a19d4fa201541b907a3f52e5b73c440ba0870c6e8a4fd068bb99
4
+ data.tar.gz: 70d726b45f982670895c1ddccbbf7e9f42b4a6ab3e6eca8439ac5e58ce399fe0
5
5
  SHA512:
6
- metadata.gz: e78405858e31da61d3361c3e42f999591e68f2053f1b58944c1f07616f5a57a599a174708eda301d52743d9dabaae8e76bf50442936401a9e943699589e0ad5c
7
- data.tar.gz: a4e9ee6327f0d0e0d68eab43af5f21126e5ccef888b7478e07e14ade2a1532f618ac95ddb80e3406956ed7e505fda76c577e63368d376955024ab65df5084aa0
6
+ metadata.gz: fcfad8b207316c8041ddd6cd8687a17b9e04c5bcdca8b73084aae2e4a241c5b2c10247fe24f513e66d939ab97289bb1206458f0fab70cc6a04415224ec62083b
7
+ data.tar.gz: c3d4148b9ddddac5eb2dc47b58c2beb6e88e0e3be9c207328e36c825adbce05826c3eaeb6b4d2023160da65286c177e3a3085f222ba7ba7eb529dab995939cb3
data/CHANGELOG.md CHANGED
@@ -4,6 +4,7 @@
4
4
 
5
5
  - Improved RBS definitions
6
6
  - Improved test coverage
7
+ - `Alphabet` now has `#include?` and `#unique_charaters` methods
7
8
 
8
9
  ## [0.4.0] - 2022-12-04
9
10
 
data/Gemfile CHANGED
@@ -9,6 +9,6 @@ gem "rake", "~> 13.0"
9
9
 
10
10
  gem "minitest", "~> 5.0"
11
11
 
12
- gem "standard", "~> 1.25"
12
+ gem "standard", "~> 1.30"
13
13
 
14
14
  gem "steep", "~> 1.5"
@@ -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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EncodedId
4
- VERSION = "1.0.0.rc1"
4
+ VERSION = "1.0.0.rc2"
5
5
  end
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.rc1
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-06 00:00:00.000000000 Z
11
+ date: 2023-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hashids