ruby_list_comprehension 0.0.3 → 0.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7a9ebff10a291db9bcaff1f0b5121098a7a754e8c1567ae272f37e346546f09c
4
- data.tar.gz: 4182e27d98a1c0030acf308d5a97410eda1b63fc9aa3ba3e1a27bc715c13432b
3
+ metadata.gz: a09a6c55f3c18f9f89ab19ba482e94c50862cb20f251fd5c83755535e248cd64
4
+ data.tar.gz: f1812c165243cd0bc3e3c1fd91415e1c1bed2bcb314a4d8c88b48d1d5e5d3683
5
5
  SHA512:
6
- metadata.gz: 45921c152d9f7c24972a99da58576e85e4d0ad4a5251b6e23fcf01b78977c22294a8177771b2590b9f882a7ad871c8aa4ab5e40dcb23527a9f6fbd3409b6ce0f
7
- data.tar.gz: 8449cbcbafdcbeb27d7c937305cf6c1fb7f46a8869b294acce3b4b46560fa0936b65c8e14b8397e67f70d8758a4f93117eab577c6f582873c56cad25eb115246
6
+ metadata.gz: 88b9c43e97223089d22f1e921f1933f39d721ad82316c7cded62175254e8d538220ce4fa40e88a61ed2d0f5b1081fd7b54aed8b8d3fc7af2ee48565f10344e41
7
+ data.tar.gz: 88ceb53a0fe56ba5342acdd361b18daf0ba7cbeb9a1f5a2a90cad4f1d84661c59ccb814dfbbc355834b8bb1e0d36c2a650b71b75e7edc9cda8ed7270ce3b9e6e
@@ -30,20 +30,20 @@ class ListComprehension
30
30
  if_condition = arr.include?('if') ? arr[arr.index('if') + 1...-1] : ['true']
31
31
  map_condition = arr[arr.index('do') + 1...(arr.index('if') || arr.index('end'))]
32
32
  if (map_condition == [arr[1]]) && (if_condition == ['true'] || if_condition == true)
33
- p "no method needed"
33
+ # p "no method needed"
34
34
  res = eval(arr[3])
35
35
  return res.is_a?(Array) ? res : [res]
36
36
  end
37
37
  self.class.send(:define_method,'lc') do |arr|
38
38
  if map_condition == [arr[1]]
39
- p 'filter'
39
+ # p 'filter'
40
40
  return eval(iterable).filter do |x|
41
41
  eval(if_condition.join(' '))
42
42
  end
43
43
  end
44
44
 
45
45
  if if_condition == ['true'] || if_condition == true
46
- p 'map'
46
+ # p 'map'
47
47
  return eval(iterable).map do |x|
48
48
  eval(map_condition.join(' '))
49
49
  end
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.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Michael