mini_service 0.0.0 → 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -6
- data/lib/mini_service/version.rb +1 -1
- data/mini_service.gemspec +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: 521aa07f48ec8e042961b602d497fa8cdc566d86f4260d20be9d6740dcee96cf
|
4
|
+
data.tar.gz: 72b008ade7364935850e3d53a14ca828e096848542f769d2757818aa2d5411e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b6846fa288706326ff07f4e82e7b51dc645abe70f91bf7f4761f6535f22cd7ae5165b87aada11be9672127aed719dfdbd58074dc8408f7a62439a789dc596d3
|
7
|
+
data.tar.gz: 57627ad9fb5d33b57b49de5263f6386876e54cc6507d1d5c52cdfb5c5ea0d34b685f8a5386021921c70d13521b00d8decacbf882da14865cf7e07e7e8e1d1b6d
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# MiniService
|
2
2
|
MiniServices are a prototype from which to build single-functionality
|
3
|
-
|
3
|
+
minimalistic services, aiming to
|
4
4
|
help you correctly modularize and isolate your processes making them easier to
|
5
5
|
mantain and less prone to
|
6
6
|
errors.
|
@@ -9,8 +9,8 @@ errors.
|
|
9
9
|
Define them like this:
|
10
10
|
```ruby
|
11
11
|
class ExampleService < MiniService::Base
|
12
|
-
|
13
|
-
|
12
|
+
mini_reqs %i[a1 a2]
|
13
|
+
mini_lets %i[a3 a4]
|
14
14
|
|
15
15
|
private
|
16
16
|
|
@@ -24,9 +24,10 @@ Call them like this:
|
|
24
24
|
```ruby
|
25
25
|
ExampleService.call(a1: 1, a2: 2) # or
|
26
26
|
ExampleService.call(a1: 1, a2: 2, a3: 3, a4: 4)
|
27
|
-
|
28
|
-
# so you can use @a1 inside perform if a1 is given in the args hash
|
27
|
+
|
29
28
|
```
|
29
|
+
Instance variables will be available for each key-value pair
|
30
|
+
so you can use `@a1` inside perform if `a1` is given in the `args` hash
|
30
31
|
|
31
32
|
Adding `mini_reqs` will raise an error if you miss `reqd` arguments
|
32
33
|
|
@@ -39,7 +40,7 @@ You can create your own services by inheriting from `MiniService::Base` class.
|
|
39
40
|
|
40
41
|
Your `MiniServices` should be used via their `call` method, providing arguments
|
41
42
|
in a hash, like
|
42
|
-
`ExampleService.call(
|
43
|
+
`ExampleService.call(a1: 1, a2: 2)` or `ExampleService.call(args)` with args
|
43
44
|
built elsewhere.
|
44
45
|
|
45
46
|
This will automatically initialize your service with one `@instance_variable`
|
data/lib/mini_service/version.rb
CHANGED
data/mini_service.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.authors = ['Rodrgo Andrés Contreras Vilina']
|
9
9
|
spec.email = ['roanvilina@gmail.com']
|
10
10
|
|
11
|
-
spec.summary = 'Provides a simple service prototype class
|
11
|
+
spec.summary = 'Provides a simple service prototype class.'
|
12
12
|
spec.homepage = 'https://github.com/roanvilina/mini_service'
|
13
13
|
spec.license = 'MIT'
|
14
14
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mini_service
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rodrgo Andrés Contreras Vilina
|
@@ -126,5 +126,5 @@ requirements: []
|
|
126
126
|
rubygems_version: 3.0.1
|
127
127
|
signing_key:
|
128
128
|
specification_version: 4
|
129
|
-
summary: Provides a simple service prototype class
|
129
|
+
summary: Provides a simple service prototype class.
|
130
130
|
test_files: []
|