strum 0.0.28 → 0.0.29

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 15db517a81bd94c5d2b0e256715dcded125a9f95160adf4c057e0e17f8329919
4
- data.tar.gz: fb713feb05e218bc6db956e9dce30b5c0f30297ebecc8f5d36cabdedb7c25384
3
+ metadata.gz: 28f83ff1c7afb2e86bc1987cedd18a3b59b619b710a5fed03482d2a15eaa9083
4
+ data.tar.gz: 91b8f3f9552004629031c1d46e3cdfa93f60f730d3a162e136203c7bb8ee9219
5
5
  SHA512:
6
- metadata.gz: 45a8552d856ef10c54792d38bc8b5ab690b2990dad97837422af9c19170e36394246b5b5706a5cfc7e92421da193f763c943e066ca924d0416867cf4f74a541b
7
- data.tar.gz: 7c64ba84549dce4473bd351be5ab49384156a6fa39c0df4f5c9ba8a58e72b00da99c02e3cde1fbdd54fa5d8ad377bd61bbecf2afda3ac1af97bc225ce80a92ac
6
+ metadata.gz: aa3a04ed892026f25804aad7d6c76d3fc6e52f5162ababf6116ecb6582285824cd1bf3b2a4e095cd505d39de68d9633af373c35af5adf245bca4a52dbe6660bf
7
+ data.tar.gz: e29bb7d1480e590b907b5e919d8bca27bea14dea722b39efb7bde464fa06a22d37ab4c76069d7d52e4fd066ae3bdd7aec1004702572ca897b361aefba4fb5cbb
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- strum (0.0.28)
4
+ strum (0.0.29)
5
5
  dry-inflector (~> 0.2.0)
6
6
  dry-matcher (~> 0.8.2)
7
7
  thor (~> 0.20)
@@ -11,6 +11,10 @@ module Strum
11
11
  serializer_class = Strum::SerializerName.call(name: name)
12
12
  output(serializer_class.new(input).serializable_hash)
13
13
  end
14
+
15
+ define_method :audit do
16
+ clear_output!
17
+ end
14
18
  end
15
19
  end
16
20
  end
data/lib/strum/service.rb CHANGED
@@ -105,6 +105,14 @@ module Strum
105
105
  end
106
106
  end
107
107
 
108
+ def sliced(*keys)
109
+ if input.is_a?(Hash)
110
+ @input = input.slice(keys)
111
+ else
112
+ add_error(:input, :must_be_hash)
113
+ end
114
+ end
115
+
108
116
  def array!
109
117
  self.input = [*input]
110
118
  end
@@ -136,11 +144,7 @@ module Strum
136
144
  return payload unless outputs.count.positive?
137
145
 
138
146
  outputs.each_with_object({}) do |(k, v), memo|
139
- memo[k] = if v.is_a?(Hash)
140
- payload.merge(v)
141
- else
142
- v
143
- end
147
+ memo[k] = v.is_a?(Hash) ? payload.merge(v) : v
144
148
  end
145
149
  end
146
150
 
data/lib/strum/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Strum
4
- VERSION = "0.0.28"
4
+ VERSION = "0.0.29"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strum
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.28
4
+ version: 0.0.29
5
5
  platform: ruby
6
6
  authors:
7
7
  - Serhiy Nazarov