tramway 0.2.1 → 0.2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tramway/base_decorator.rb +5 -1
- data/lib/tramway/decorators/collection_decorator.rb +2 -2
- data/lib/tramway/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f21d3c15fcbad670039714c4661be3546849982618662fec4de88d5fa7f46ce3
|
4
|
+
data.tar.gz: ed77adc5f2247c5db97e23b0c6706219689afcbbedd02db3597d2e31f1adde23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58c2ce7f3f93ae17fd399d1fff01e0abce89f0a687aba960d5431be777f2ec2ae0078d68d9f9bdffadedce5b67004a4a487a30ad29e09e7927fb1b808a83843c
|
7
|
+
data.tar.gz: 2b1ff7fa17dfb4e8eed897bdaab83b32a58f0230a12a24d2bf37f9334779d7abf180949d50444b0e75623efd9db10a9b116d231a923b16efbb6af507d218a17b
|
@@ -22,7 +22,11 @@ module Tramway
|
|
22
22
|
class << self
|
23
23
|
def decorate(object_or_array, context)
|
24
24
|
if Tramway::Decorators::CollectionDecorators.collection?(object_or_array)
|
25
|
-
Tramway::Decorators::CollectionDecorators.decorate_collection(
|
25
|
+
Tramway::Decorators::CollectionDecorators.decorate_collection(
|
26
|
+
collection: object_or_array,
|
27
|
+
context:,
|
28
|
+
decorator: self
|
29
|
+
)
|
26
30
|
else
|
27
31
|
new(object_or_array, context)
|
28
32
|
end
|
@@ -7,9 +7,9 @@ module Tramway
|
|
7
7
|
module CollectionDecorators
|
8
8
|
module_function
|
9
9
|
|
10
|
-
def decorate_collection(collection:, context:)
|
10
|
+
def decorate_collection(collection:, context:, decorator:)
|
11
11
|
collection.map do |item|
|
12
|
-
|
12
|
+
decorator.decorate item, context
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
data/lib/tramway/version.rb
CHANGED