ruby-ulid 0.0.13 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ulid.rb +3 -4
- data/lib/ulid/version.rb +1 -1
- data/sig/ulid.rbs +1 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa89ecbb2a09940666b57e690d43a985872bb85f40b2b1175c79a762d79c8e45
|
4
|
+
data.tar.gz: 2404fe5e1efa77899262fbf8979529fc474e44ffa0a8572ee3cf71eb1caf941a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a86224846b27985d641bf485f952583c73dafc87a0ca8f65744cfdfa35371a6f5cfedb4246e7839da6e51fdcfd53632f20057c399038f3399f2986a9bf20085
|
7
|
+
data.tar.gz: 24daff089a2b0564a2e7a93c34fef4d44420d1e0bbc6a054c5bcdfac02986c66204515bc085a7dc6499257692682217a888d8a04e04a7ae8de36e884cc182965
|
data/lib/ulid.rb
CHANGED
@@ -261,10 +261,9 @@ class ULID
|
|
261
261
|
end
|
262
262
|
|
263
263
|
# @return [String]
|
264
|
-
def
|
264
|
+
def to_s
|
265
265
|
@string ||= Integer::Base.string_for(to_i, ENCODING_CHARS).rjust(ENCODED_ID_LENGTH, '0').upcase.freeze
|
266
266
|
end
|
267
|
-
alias_method :to_s, :to_str
|
268
267
|
|
269
268
|
# @return [Integer]
|
270
269
|
def to_i
|
@@ -279,7 +278,7 @@ class ULID
|
|
279
278
|
|
280
279
|
# @return [String]
|
281
280
|
def inspect
|
282
|
-
@inspect ||= "ULID(#{to_time.strftime(TIME_FORMAT_IN_INSPECT)}: #{
|
281
|
+
@inspect ||= "ULID(#{to_time.strftime(TIME_FORMAT_IN_INSPECT)}: #{to_s})".freeze
|
283
282
|
end
|
284
283
|
|
285
284
|
# @return [Boolean]
|
@@ -381,7 +380,7 @@ class ULID
|
|
381
380
|
|
382
381
|
# @return [MatchData]
|
383
382
|
def matchdata
|
384
|
-
@matchdata ||= STRICT_PATTERN.match(
|
383
|
+
@matchdata ||= STRICT_PATTERN.match(to_s).freeze
|
385
384
|
end
|
386
385
|
end
|
387
386
|
|
data/lib/ulid/version.rb
CHANGED
data/sig/ulid.rbs
CHANGED
@@ -79,8 +79,7 @@ class ULID
|
|
79
79
|
attr_reader milliseconds: Integer
|
80
80
|
attr_reader entropy: Integer
|
81
81
|
def initialize: (milliseconds: Integer, entropy: Integer) -> void
|
82
|
-
def
|
83
|
-
alias to_s to_str
|
82
|
+
def to_s: -> String
|
84
83
|
def to_i: -> Integer
|
85
84
|
alias hash to_i
|
86
85
|
def <=>: (ULID other) -> Integer
|