cascade-rb 0.2.1 → 0.2.2
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d26998810ac71323dc84adce37888cb7bbce2127
|
4
|
+
data.tar.gz: ac4635ee292536f00506ecd96a6cee059ec0745e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2942683553dbdef1d91b028f7720e9f284d8df08640bd76c9403da70b77ec2a959292aa0f268835fd0c647c4eae715c55fba061510423415c8f8067e3806a55
|
7
|
+
data.tar.gz: bebf683f1b2bbabf727555aca0c114373612c93a7f0cced61ffc836e07f2f576d37d365b791c66f5e56fdd82a4e1074c0c095944e0c8e277fc9861efeddee482
|
@@ -47,12 +47,17 @@ module Cascade
|
|
47
47
|
@presenters ||= options.reverse_merge(defined_presenters)
|
48
48
|
end
|
49
49
|
|
50
|
+
def self_copy
|
51
|
+
self.class.new(options)
|
52
|
+
end
|
53
|
+
|
50
54
|
def defined_presenters
|
51
55
|
{
|
52
|
-
string:
|
53
|
-
currency:
|
54
|
-
boolean:
|
55
|
-
|
56
|
+
string: DEFAULT_PROCESSOR,
|
57
|
+
currency: ComplexFields::Currency.new,
|
58
|
+
boolean: ComplexFields::Boolean.new,
|
59
|
+
iterable_recursive: ComplexFields::ArrayProcessor.new(self_copy),
|
60
|
+
recursive: self_copy
|
56
61
|
}
|
57
62
|
end
|
58
63
|
end
|
data/lib/cascade/version.rb
CHANGED
@@ -0,0 +1,15 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
require "cascade/complex_fields/array_processor"
|
3
|
+
|
4
|
+
describe Cascade::ComplexFields::ArrayProcessor do
|
5
|
+
def described_class
|
6
|
+
Cascade::ComplexFields::ArrayProcessor
|
7
|
+
end
|
8
|
+
|
9
|
+
let(:processor) { -> (value) { value + 1 } }
|
10
|
+
let(:subject) { described_class.new(processor) }
|
11
|
+
|
12
|
+
it "return processed array" do
|
13
|
+
assert_equal subject.call([1, 2, 3]), [2, 3, 4]
|
14
|
+
end
|
15
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cascade-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ignat Zakrevsky
|
@@ -167,6 +167,7 @@ files:
|
|
167
167
|
- lib/cascade.rb
|
168
168
|
- lib/cascade/columns_matching.rb
|
169
169
|
- lib/cascade/complex_fields.rb
|
170
|
+
- lib/cascade/complex_fields/array_processor.rb
|
170
171
|
- lib/cascade/complex_fields/boolean.rb
|
171
172
|
- lib/cascade/complex_fields/currency.rb
|
172
173
|
- lib/cascade/concerns/statistics_collectible.rb
|
@@ -187,6 +188,7 @@ files:
|
|
187
188
|
- lib/cascade/statistics_stores/counter_store.rb
|
188
189
|
- lib/cascade/version.rb
|
189
190
|
- spec/lib/columns_matching_spec.rb
|
191
|
+
- spec/lib/complex_fields/array_processor_spec.rb
|
190
192
|
- spec/lib/complex_fields/boolean_spec.rb
|
191
193
|
- spec/lib/complex_fields/currency_spec.rb
|
192
194
|
- spec/lib/concerns/statistics_collectible_spec.rb
|
@@ -230,6 +232,7 @@ specification_version: 4
|
|
230
232
|
summary: Ruby data parser gem.
|
231
233
|
test_files:
|
232
234
|
- spec/lib/columns_matching_spec.rb
|
235
|
+
- spec/lib/complex_fields/array_processor_spec.rb
|
233
236
|
- spec/lib/complex_fields/boolean_spec.rb
|
234
237
|
- spec/lib/complex_fields/currency_spec.rb
|
235
238
|
- spec/lib/concerns/statistics_collectible_spec.rb
|