use_cases 2.0.2 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 92d41d9c7f9da2600b22ffcad2013a9115f39f42ef41df49b2c592a18fb4115b
4
- data.tar.gz: c0a3f6f88235e144107ba141b3e8add9bcca2ee42dce3f2f2e0ea0562ef114a3
3
+ metadata.gz: 0e64ac5284a76952a2d0da6e2d48ea40b93af03926b5f4d0a23a38698836dfe0
4
+ data.tar.gz: b9c894909398b9cc287da875175f125319243b0dd077158d27b59e498e184cbe
5
5
  SHA512:
6
- metadata.gz: 251c8400f48af05b11ea871a2750531071548050725f341aabd8bfb4a1bca8b68a1fd6d69eb1db3b6af93da888f89e37bd5985c6933a3f541ac63650fccf8ba1
7
- data.tar.gz: 65e556b50fe0cd77bef9c0d0e4c9652c88434a53b616a46677e352df7a4469e6b6c8959274859989ed821f305c3a90342476302df7e60971dbc2708b4c40e300
6
+ metadata.gz: a34740d4caa9274eeed8e76ebc20293c3dc1e962551b35b3c14b885e018135d51a7f27f832b9ca02b0639a6bf4e4e4febcf4567bd7ed6531077940e709f9e84f
7
+ data.tar.gz: 728d1da8f92f9d375b11172fc68f4b8aab7e4b9efa048a88959bd9996d327a27bda9432948fdd82d8dcae0fab05a64e4127efb343441b7d4f0e8e5b66d1ed31b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- use_cases (2.0.2)
4
+ use_cases (2.0.3)
5
5
  activesupport (>= 5.1)
6
6
  dry-matcher (>= 0.8.1)
7
7
  dry-monads (>= 1.0.0)
data/lib/use_cases/dsl.rb CHANGED
@@ -14,6 +14,10 @@ module UseCases
14
14
  end
15
15
  end
16
16
 
17
+ def remove_step(name)
18
+ __steps__.delete_if { |step| step.name == name }
19
+ end
20
+
17
21
  def __steps__
18
22
  @__steps__ ||= []
19
23
  end
@@ -38,18 +38,17 @@ module UseCases
38
38
  raise StepArgumentError,
39
39
  "##{step.name} expects #{expected_args_count} arguments it only received #{step_args.count}, make sure your previous step Success() statement has a payload."
40
40
  end
41
-
42
41
  return args.first(callable_args_count) unless external? && selects_external_args?
43
42
 
44
43
  hashed_args(args).values
45
44
  end
46
45
 
47
- def hashed_args(args)
46
+ def hashed_args((prev_result, params, current_user))
48
47
  {
49
- params: args.first,
50
- current_user: args.last,
51
- previous_step_result: args.last
52
- }.slice(pass_option)
48
+ previous_step_result: prev_result,
49
+ params: params,
50
+ current_user: current_user,
51
+ }.slice(*pass_option)
53
52
  end
54
53
 
55
54
  def callable_proc
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module UseCases
4
- VERSION = "2.0.2"
4
+ VERSION = "2.0.3"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: use_cases
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ring Twice
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-08-04 00:00:00.000000000 Z
11
+ date: 2022-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport