simple-result 0.2.0 → 0.3.0
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/lib/simple_result/helpers.rb +13 -0
- data/lib/simple_result/version.rb +1 -1
- data/lib/simple_result.rb +0 -3
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a28433dee40d5469ac6b92034d61a4a68f31df8805cb4fb2c354ff76f5d3f28
|
4
|
+
data.tar.gz: 420d09302a2a8caa0eca7eb062af8bb96debd12e0ccad10646af7f251bbdc982
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e5003ea1d2c8f8393fe07d7a59ccb3af12ae1af6d8e61a062bc8da97bef85df798373d638fcb5106c5ef8cf897aef4d5329f3e2e9931695f654533821a0da59
|
7
|
+
data.tar.gz: f15c62b67f3337f0dea4c3c0b55628604cbd9b730bc50caab048e06d2fd194eb29f4b575b92a3bf9dfdab0c6d24a1140dfa798a50811f3a14790fdacc9381b32
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module SimpleResult
|
4
|
+
module Helpers
|
5
|
+
def Success(payload = nil) # rubocop:disable Naming/MethodName -- These are helpers methods defined specifically like this to look similar with the classes
|
6
|
+
SimpleResult::Success.new(payload)
|
7
|
+
end
|
8
|
+
|
9
|
+
def Failure(error = nil) # rubocop:disable Naming/MethodName -- These are helpers methods defined specifically like this to look similar with the classes
|
10
|
+
SimpleResult::Failure.new(error:)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
data/lib/simple_result.rb
CHANGED
@@ -55,6 +55,3 @@ module SimpleResult
|
|
55
55
|
def pretty_print(pp) = pp.text "#<data #{self.class.name} error=#{error.inspect}>"
|
56
56
|
end
|
57
57
|
end
|
58
|
-
|
59
|
-
def Success(payload = nil) = SimpleResult::Success.new(payload) # rubocop:disable Naming/MethodName -- These are helpers methods defined specifically like this to look similar with the classes
|
60
|
-
def Failure(error = nil) = SimpleResult::Failure.new(error:) # rubocop:disable Naming/MethodName -- These are helpers methods defined specifically like this to look similar with the classes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple-result
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lucian Ghinda
|
@@ -33,6 +33,7 @@ extra_rdoc_files: []
|
|
33
33
|
files:
|
34
34
|
- README.md
|
35
35
|
- lib/simple_result.rb
|
36
|
+
- lib/simple_result/helpers.rb
|
36
37
|
- lib/simple_result/version.rb
|
37
38
|
homepage: https://github.com/lucianghinda/simple_result
|
38
39
|
licenses:
|