var_block 1.0.4 → 1.0.5

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
  SHA1:
3
- metadata.gz: 1558d1459d0a4c2e35d2310b99f8477f04b5b92d
4
- data.tar.gz: bcc50d0ccb6d7d08f2569f428c2ba88e94c9f751
3
+ metadata.gz: e4402003ba6ed9894c5c346f3dac996e8b0a52c1
4
+ data.tar.gz: e1f48bd2618296ba9392180cbd0cdd6b6d6c4568
5
5
  SHA512:
6
- metadata.gz: 7dd24620dd90615fb567107d70507b8e15531a45f7b7acec06951e53a05fb287f424e8b8eec5c2a86076c69ba9f6fef28bb9740495f308f4f7d078aa9d2c6738
7
- data.tar.gz: b677a48857503d2201933ca60f1a9224375e6bb1eb59970534162f6d47d70ca53f2d7e6686e7d50131523e2c64f8596601319b8a6e87d14a6342267bc899054b
6
+ metadata.gz: f23bea2ab3859970eaa3669d961a75634a4f569fe22eace63c785f76037a41add32d381b0a8644f45518fe970182a1720798f0d1a837dbb06ae16db598da1dcb
7
+ data.tar.gz: 7dacd9c7c46940e469e55e0fdff1d602cffc3a449f43847d18462a90df1f5461019d45589795183e37591d6bf8217e380f16186aef5bb0038f5c537f042386fa
@@ -29,7 +29,7 @@ module VarBlock
29
29
 
30
30
  def handle(value, context, options)
31
31
  if options.any?
32
- return handle_options(value, options)
32
+ return handle_options(value, context, options)
33
33
 
34
34
  # else, if no options, defaults to return as a wrapped Array
35
35
  else
@@ -49,20 +49,20 @@ module VarBlock
49
49
 
50
50
  private
51
51
 
52
- def handle_options(value, options)
52
+ def handle_options(value, context, options)
53
53
  options.each do |option|
54
54
  case option
55
55
 
56
56
  when :truthy?
57
- return handle_option_truthy(value)
57
+ return handle_option_truthy(value, context)
58
58
 
59
59
  when :any?
60
- return handle_option_any(value)
60
+ return handle_option_any(value, context)
61
61
  end
62
62
  end
63
63
  end
64
64
 
65
- def handle_option_truthy(values)
65
+ def handle_option_truthy(values, context)
66
66
  is_truthy = true
67
67
 
68
68
  values.each do |value|
@@ -78,7 +78,7 @@ module VarBlock
78
78
  return is_truthy
79
79
  end
80
80
 
81
- def handle_option_any(values)
81
+ def handle_option_any(values, context)
82
82
  values.each do |value|
83
83
  if value.is_a? Proc
84
84
  evaluated_value = ProcHandler.handle(value, context)
@@ -1,3 +1,3 @@
1
1
  module VarBlock
2
- VERSION = '1.0.4'.freeze
2
+ VERSION = '1.0.5'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: var_block
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jules Roman B. Polidario