mystique 0.4.4 → 0.5.0
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 +4 -4
- data/lib/mystique.rb +9 -1
- data/lib/mystique/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2ac4da940e9aac44e5b6f93bfd18fa763c8df251
|
|
4
|
+
data.tar.gz: 67fda67586d2e8a24917d05a122618c2a10b7610
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6d53b48665b24a79853ffbfd34660a15059ff3f45f20dc7f1e932a123967198bf30ee173b6bd776ac0a90713892371eb5c1728f4c39a57b098982a3cbc134809
|
|
7
|
+
data.tar.gz: 2f4532ee0b213475c9f4547c6d5539d9e40e2eed317b633aa9564f0068628eb8a77a2acd3ead67c2acbe4397a7266d1d9a50a15705b6c06693e527e48f5bef53
|
data/lib/mystique.rb
CHANGED
|
@@ -53,7 +53,7 @@ module Mystique
|
|
|
53
53
|
else
|
|
54
54
|
value
|
|
55
55
|
end
|
|
56
|
-
Callable(result).call(value, context)
|
|
56
|
+
Mystique.present(Callable(result).call(value, context))
|
|
57
57
|
end
|
|
58
58
|
|
|
59
59
|
def self.context(ctx=Undefined)
|
|
@@ -117,4 +117,12 @@ module Mystique
|
|
|
117
117
|
end
|
|
118
118
|
presenter_class.present(object, context, &block)
|
|
119
119
|
end
|
|
120
|
+
|
|
121
|
+
def present_collection(collection, context: nil, &block)
|
|
122
|
+
return to_enum(:present_collection, collection, context: context, &block) unless block_given?
|
|
123
|
+
|
|
124
|
+
collection.each do |element|
|
|
125
|
+
block.call present(element, context: context)
|
|
126
|
+
end
|
|
127
|
+
end
|
|
120
128
|
end
|
data/lib/mystique/version.rb
CHANGED