iron_oxide 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/FUNDING.yml +1 -1
- data/.github/workflows/ruby-tests.yml +2 -2
- data/CHANGELOG.md +8 -0
- data/lib/iron_oxide/aliases.rb +5 -2
- data/lib/iron_oxide/option.rb +9 -0
- data/lib/iron_oxide/result.rb +12 -0
- data/lib/iron_oxide/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8cc37a56001f57c84184d8fc493ef41297560a71d3e6721b1df9fccca6e4390
|
4
|
+
data.tar.gz: 359d8b8fe95b6647460b4fded5bf27ed4a63d85f229affb5b225fa9cef312fe7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55304e8bf2b492a6e0acaa59fc64efdafd967aa29068dccc04709bed9bca4c3d4058969c17d872b7041c6cca9e8e65e517389734d260ff8048d53b83e0ec7cd3
|
7
|
+
data.tar.gz: 6e430deaf2d6ebb0e2e6a107ea5fe0221e16425cfd8ec692bbf8a74a29819dcab49e2a12e526829bbd94d34fa21695fb81b3c3b650e38b79e624ffc498c9db41
|
data/.github/FUNDING.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -11,6 +11,14 @@ Prefix your message with one of the following:
|
|
11
11
|
- [Security] in case of vulnerabilities.
|
12
12
|
-->
|
13
13
|
|
14
|
+
## 0.0.3
|
15
|
+
|
16
|
+
[Fixed] Constant override warning.
|
17
|
+
|
18
|
+
## 0.0.2
|
19
|
+
|
20
|
+
- [Added] Pattern matching support.
|
21
|
+
|
14
22
|
## 0.0.1
|
15
23
|
|
16
24
|
- Initial release.
|
data/lib/iron_oxide/aliases.rb
CHANGED
@@ -2,12 +2,15 @@
|
|
2
2
|
|
3
3
|
module IronOxide
|
4
4
|
module Aliases
|
5
|
+
Some = Option::SomeClass
|
6
|
+
Ok = Result::OkClass
|
7
|
+
Err = Result::ErrClass
|
8
|
+
None = Option::None
|
9
|
+
|
5
10
|
def Some(value) # rubocop:disable Naming/MethodName
|
6
11
|
Option::Some(value)
|
7
12
|
end
|
8
13
|
|
9
|
-
None = Option::None
|
10
|
-
|
11
14
|
def Ok(value) # rubocop:disable Naming/MethodName
|
12
15
|
Result::Ok(value)
|
13
16
|
end
|
data/lib/iron_oxide/option.rb
CHANGED
@@ -5,6 +5,15 @@ module IronOxide
|
|
5
5
|
class Base
|
6
6
|
attr_reader :value
|
7
7
|
|
8
|
+
# Deconstructs the instance into an array.
|
9
|
+
def deconstruct
|
10
|
+
[value]
|
11
|
+
end
|
12
|
+
|
13
|
+
def deconstruct_keys(*)
|
14
|
+
{value:}
|
15
|
+
end
|
16
|
+
|
8
17
|
# Checks if the instance represents a `Some` value.
|
9
18
|
def some?
|
10
19
|
instance_of?(SomeClass)
|
data/lib/iron_oxide/result.rb
CHANGED
@@ -9,6 +9,18 @@ module IronOxide
|
|
9
9
|
@value = value
|
10
10
|
end
|
11
11
|
|
12
|
+
# Deconstructs the instance into an array, so it can be using on
|
13
|
+
# pattern matching.
|
14
|
+
def deconstruct
|
15
|
+
[value]
|
16
|
+
end
|
17
|
+
|
18
|
+
# Deconstructs the instance into a hash, so it can be using on
|
19
|
+
# pattern matching.
|
20
|
+
def deconstruct_keys(*)
|
21
|
+
{value:}
|
22
|
+
end
|
23
|
+
|
12
24
|
# Compares the current result with another result.
|
13
25
|
def ==(other)
|
14
26
|
Result.result?(other) &&
|
data/lib/iron_oxide/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iron_oxide
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nando Vieira
|
@@ -147,10 +147,10 @@ metadata:
|
|
147
147
|
rubygems_mfa_required: 'true'
|
148
148
|
homepage_uri: https://github.com/fnando/iron_oxide
|
149
149
|
bug_tracker_uri: https://github.com/fnando/iron_oxide/issues
|
150
|
-
source_code_uri: https://github.com/fnando/iron_oxide/tree/v0.0.
|
151
|
-
changelog_uri: https://github.com/fnando/iron_oxide/tree/v0.0.
|
152
|
-
documentation_uri: https://github.com/fnando/iron_oxide/tree/v0.0.
|
153
|
-
license_uri: https://github.com/fnando/iron_oxide/tree/v0.0.
|
150
|
+
source_code_uri: https://github.com/fnando/iron_oxide/tree/v0.0.3
|
151
|
+
changelog_uri: https://github.com/fnando/iron_oxide/tree/v0.0.3/CHANGELOG.md
|
152
|
+
documentation_uri: https://github.com/fnando/iron_oxide/tree/v0.0.3/README.md
|
153
|
+
license_uri: https://github.com/fnando/iron_oxide/tree/v0.0.3/LICENSE.md
|
154
154
|
post_install_message:
|
155
155
|
rdoc_options: []
|
156
156
|
require_paths:
|