wolf_core 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wolf_core/utils/result.rb +23 -25
- data/lib/wolf_core/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e248e9a83f9374490b7047d514ee10c3d129f51f6551766eaa65e9a0196212d6
|
4
|
+
data.tar.gz: 85a6f0ba8cb51f8fba268953dffb3cf7e3a83afe9d27e239252b275b874a31da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 624b4b1c6bf86070387036c160fa29d2d8c61bc3bebb62ec1fa9dd85c80896187326700790866716a6a666ca83d8842ca7371dc9f04400dd80b568d62e8250ff
|
7
|
+
data.tar.gz: 93a45b3622cc751b263b4c555c6325e9bb651ab0604c8c359efc0b77300c5fbe5ad266adb87b993249d2c6522733ca8b77cc347f274bf95ca9cae1c6cb1d8e1e
|
@@ -1,27 +1,25 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
!@success
|
25
|
-
end
|
1
|
+
class Result
|
2
|
+
attr_accessor :data, :error
|
3
|
+
|
4
|
+
def initialize(success:, data: nil, error: nil)
|
5
|
+
@success = success
|
6
|
+
@data = data
|
7
|
+
@error = error
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.success(data: {})
|
11
|
+
Result.new(success: true, data: OpenStruct.new(data))
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.failure(error: {})
|
15
|
+
Result.new(success: false, error: OpenStruct.new(error))
|
16
|
+
end
|
17
|
+
|
18
|
+
def success?
|
19
|
+
@success
|
20
|
+
end
|
21
|
+
|
22
|
+
def failure?
|
23
|
+
!@success
|
26
24
|
end
|
27
25
|
end
|
data/lib/wolf_core/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wolf_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Javier Roncallo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-07-
|
11
|
+
date: 2024-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|