Skip to content

Commit f0ce6e3

Browse files
authored
Merge pull request #5 from sequenia/develop
[*] Named parameter 'data' in the 'error' method
2 parents 09a2f66 + 2b8bfed commit f0ce6e3

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
single_action_service (0.1.0)
4+
single_action_service (0.3.0)
55

66
GEM
77
remote: https://rubygems.org/
@@ -32,4 +32,4 @@ DEPENDENCIES
3232
single_action_service!
3333

3434
BUNDLED WITH
35-
1.17.2
35+
1.17.3

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ success
5454
```
5555
5. Or return an error:
5656
```ruby
57-
return error(sum, code: 1) unless sum.positive?
57+
return error(data: sum, code: 1) unless sum.positive?
5858
```
59-
The first parameter is any data (optional).
59+
The 'data' parameter is any data (optional).
6060

6161
The 'code' parameter is used to identify the error (optional).
6262

lib/single_action_service/base.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ def success(data = nil)
66
Result.new(true, data: data)
77
end
88

9-
def error(data = nil, code: nil)
9+
def error(data: nil, code: nil)
1010
Result.new(false, data: data, error_code: code)
1111
end
1212
end
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module SingleActionService
2-
VERSION = "0.2.0"
2+
VERSION = "0.3.0"
33
end

0 commit comments

Comments
 (0)