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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c98ac6df6bb53e83ad1eafbb630dae2bdfd4f751ae3980d8cd3dfeabe0f38cbe
4
- data.tar.gz: 0c3bf63664daf1987027bcb719b5e9fe3cbf1fa816d151f9a0881ec803710acc
3
+ metadata.gz: 23c22664dc16e1c6983947ecc19359e6e0c1dc7327ea8850ad1aae4e53d5e61a
4
+ data.tar.gz: eb6a66b46874120f6e6f442fce33197a5a81ecd3ec1e60737b0b09d91f1a92f9
5
5
  SHA512:
6
- metadata.gz: 2622a26bde77b8f3ee314a52db76e2650d0020a9c18ca4a38c147a98a7aeb4762af5a52e8878baa33a1677764525a62dbb321a6de080b8133029dd901f9e4335
7
- data.tar.gz: 300dd50e3138851e1ad102dd1551fb37cc7604f970f1162c4de0f36d4146c66be18a397b443463cc7e4a9963d1fa6796736c7a9d6953888d9d9c930ecaf754d7
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 arr.index(first_hash) == 3
62
- if instance_eval(m_data[0].split(';')[0]).is_a? Hash
63
- iterable = m_data[0].split(';')[0]
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(' ')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_list_comprehension
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Michael