ruby_list_comprehension 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ruby_list_comprehension.rb +4 -3
- 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: 23c22664dc16e1c6983947ecc19359e6e0c1dc7327ea8850ad1aae4e53d5e61a
|
4
|
+
data.tar.gz: eb6a66b46874120f6e6f442fce33197a5a81ecd3ec1e60737b0b09d91f1a92f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78bb02e901b5caf0d51b97ad6cd0ed6a313947e20a9421e42ecce95c251b22e7495343cf58909038d6acd1f7d689aef2f49ee481d1eef2d98091be49f9a64024
|
7
|
+
data.tar.gz: f062f75e7dcdb9f567c2d32894897f3e257fd18f33b495cc879c9e4dcec2d613650ada4f06639bbe468860ad7e6b7c38919ec89c195c49c4fcfc814822025e79
|
@@ -58,13 +58,14 @@ class ListComprehension
|
|
58
58
|
m_data = copy1[3...copy1.rindex('do')].match(/({.+[=>:].+})/)
|
59
59
|
if m_data
|
60
60
|
first_hash = m_data[0].split(';')[0]
|
61
|
-
if
|
62
|
-
if instance_eval(
|
63
|
-
iterable =
|
61
|
+
if @list.index(first_hash) == 9
|
62
|
+
if instance_eval(first_hash).is_a? Hash
|
63
|
+
iterable = first_hash
|
64
64
|
end
|
65
65
|
end
|
66
66
|
end
|
67
67
|
@iterable = instance_eval(iterable)
|
68
|
+
# p @iterable
|
68
69
|
if_condition = arr.include?('if') ? arr[arr.index('if') + 1...-1] : ['true']
|
69
70
|
map_condition = arr[arr.index('do') + 1...(arr.index('if') || arr.index('end'))]
|
70
71
|
@filterable = if_condition.join(' ')
|