muina 0.3.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/muina/maybe/none.rb +9 -1
- data/lib/muina/maybe/some.rb +7 -1
- data/lib/muina/result/failure.rb +20 -0
- data/lib/muina/result/success.rb +20 -0
- data/lib/muina/result.rb +15 -0
- data/lib/muina/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f7322acdc8c2503f893db20260a561551cd9cc3350d07ccaa7c0a9b929ce7007
|
4
|
+
data.tar.gz: 29679c640cc94c29860a9237cf82bcd9fcb3c363481dbe214ccbe5b3ac8e5feb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f2fec87c12b2e968d621663781b9e9e079f10fd6bda0e7d9aabadbeadbd01851de54eb1e393def47e63b066a3c0c62dcc1cf5f101e8b33bb68b9c10430c2f02
|
7
|
+
data.tar.gz: 1431602da952ac911732a3284c9a6f73383ddecb20c4b1fe2bb477a970c8724404c6097518a0ee5d8005d10cd631c03a519aebc032173f060af3fc5d4ae4ada8
|
data/lib/muina/maybe/none.rb
CHANGED
@@ -4,6 +4,10 @@ module Muina
|
|
4
4
|
class Maybe
|
5
5
|
class None < self
|
6
6
|
private_class_method(:new)
|
7
|
+
def initialize
|
8
|
+
freeze
|
9
|
+
end
|
10
|
+
|
7
11
|
def some?
|
8
12
|
false
|
9
13
|
end
|
@@ -40,7 +44,7 @@ module Muina
|
|
40
44
|
def map
|
41
45
|
self
|
42
46
|
end
|
43
|
-
|
47
|
+
|
44
48
|
def map_none
|
45
49
|
Maybe.return yield
|
46
50
|
end
|
@@ -52,6 +56,10 @@ module Muina
|
|
52
56
|
def bind_none
|
53
57
|
yield
|
54
58
|
end
|
59
|
+
|
60
|
+
def ==(other)
|
61
|
+
self.class == other.class
|
62
|
+
end
|
55
63
|
end
|
56
64
|
end
|
57
65
|
end
|
data/lib/muina/maybe/some.rb
CHANGED
@@ -5,6 +5,7 @@ module Muina
|
|
5
5
|
class Some < self
|
6
6
|
def initialize(value)
|
7
7
|
@value = value
|
8
|
+
freeze
|
8
9
|
end
|
9
10
|
private_class_method(:new)
|
10
11
|
|
@@ -44,7 +45,7 @@ module Muina
|
|
44
45
|
def map
|
45
46
|
Maybe.return yield(@value)
|
46
47
|
end
|
47
|
-
|
48
|
+
|
48
49
|
def map_none
|
49
50
|
self
|
50
51
|
end
|
@@ -56,6 +57,11 @@ module Muina
|
|
56
57
|
def bind_none
|
57
58
|
self
|
58
59
|
end
|
60
|
+
|
61
|
+
def ==(other)
|
62
|
+
self.class == other.class &&
|
63
|
+
self.value! == other.value!
|
64
|
+
end
|
59
65
|
end
|
60
66
|
end
|
61
67
|
end
|
data/lib/muina/result.rb
ADDED
data/lib/muina/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: muina
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- vaporyhumo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-06-
|
11
|
+
date: 2024-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: zeitwerk
|
@@ -37,6 +37,9 @@ files:
|
|
37
37
|
- lib/muina/maybe.rb
|
38
38
|
- lib/muina/maybe/none.rb
|
39
39
|
- lib/muina/maybe/some.rb
|
40
|
+
- lib/muina/result.rb
|
41
|
+
- lib/muina/result/failure.rb
|
42
|
+
- lib/muina/result/success.rb
|
40
43
|
- lib/muina/version.rb
|
41
44
|
homepage: https://github.com/vaporyhumo/muina
|
42
45
|
licenses:
|