flame-flash 2.3.0 → 2.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/flame/flash_array.rb +11 -0
- 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: 15ec5eafd3c1f0c0795ca3f5794eeede417eaec0
|
4
|
+
data.tar.gz: 3b4d042da4f761a02e0d35c6ed70e61437cfa752
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69374426d41ae6bbea6538e7fd40c7c52e4cf12e358442c7261e503c5c8e639a73564dbd701bbabcd572e416067ec4b1c13235773a39165e6b7197e12af9bd27
|
7
|
+
data.tar.gz: 302830761a9bb393c7224d2cf638597999b0ae4982a21716676b1815ad45091037b8a155391432a24e55833083a3f03ac5c3bf32fddc35e3d66add2cbc8084e6
|
data/lib/flame/flash_array.rb
CHANGED
@@ -10,6 +10,7 @@ module Flame
|
|
10
10
|
# as an initialization variable.
|
11
11
|
def initialize(session, parent = nil, scope = nil)
|
12
12
|
@now = session || []
|
13
|
+
fix_messages_as_array
|
13
14
|
@next = []
|
14
15
|
@parent = parent || self
|
15
16
|
@scope = scope
|
@@ -59,6 +60,16 @@ module Flame
|
|
59
60
|
def condition(hash, options = {}) # kind, section)
|
60
61
|
options.reject { |key, val| hash[key] == val || val.nil? }.empty?
|
61
62
|
end
|
63
|
+
|
64
|
+
def fix_messages_as_array
|
65
|
+
@now.each do |hash|
|
66
|
+
next unless hash[:text].is_a?(Array)
|
67
|
+
hash_with_arr = @now.delete(hash)
|
68
|
+
hash_with_arr[:text].each do |text|
|
69
|
+
@now.push(hash_with_arr.merge(text: text))
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
62
73
|
end
|
63
74
|
end
|
64
75
|
end
|