var_block 1.0.0 → 1.0.1

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
  SHA1:
3
- metadata.gz: 9a6fc951b6f6f1baf1c71a9ae4ab6f7ccc08e873
4
- data.tar.gz: 4c2eeba57f1742ae009d08f882d8ca6103851a25
3
+ metadata.gz: 998eea81e5e8b080b472fad0b6c0d1ef180290d4
4
+ data.tar.gz: 8adc603eff6364c638f563c008f3cc421cd6da77
5
5
  SHA512:
6
- metadata.gz: aa5f1b5fc5f2f7ab429f9ace3a071b98f58bc81df3a7d7f6cc1996eb59b3dc426cab368e9ecded902caaa9ff61379552de6a375f1edcdbe70a6ae504a330cfd9
7
- data.tar.gz: d695370ead7ec3c5561c8600419959ddfb91e7e6d153b96193a9de9336c1ca017e972ca799d72d29ce1e3e02d0f2a13f5f6635db232ef709fdd64547b3a29c69
6
+ metadata.gz: 8180177a0f953389e1a8a07de925fd1c1d8211081ebc51c7d80591f22cca546d6312a16c972642c7e540e71b8d1f42fbc6de7c4c05c5716282a511b8147e0bcd
7
+ data.tar.gz: 6368db29acf39544be5702521d62b8f25820a9d4534d24c7021ccb04043ea9d4dcdbb80204c4a7b5c5397708997082f81e2e96538bb7e3d275d14ae6fd836b68
@@ -44,32 +44,40 @@ module VarBlock
44
44
  case option
45
45
 
46
46
  when :truthy?
47
- is_truthy = true
48
-
49
- value.each do |v|
50
- if v.is_a? Proc
51
- is_truthy = handle_proc(v, context)
52
- else
53
- is_truthy = handle_default(v)
54
- end
55
- break unless is_truthy
56
- end
57
-
58
- return is_truthy
47
+ return handle_option_truthy(value)
59
48
 
60
49
  when :any?
61
- value.each do |v|
62
- if v.is_a? Proc
63
- is_truthy = handle_proc(v, context)
64
- else
65
- is_truthy = handle_default(v)
66
- end
67
- return true if is_truthy
68
- end
50
+ return handle_option_any(value)
51
+ end
52
+ end
53
+ end
54
+
55
+ def handle_option_truthy(values)
56
+ is_truthy = true
69
57
 
70
- return false
58
+ values.each do |value|
59
+ if value.is_a? Proc
60
+ is_truthy = handle_proc(value, context)
61
+ else
62
+ is_truthy = handle_default(value)
71
63
  end
64
+ break unless is_truthy
72
65
  end
66
+
67
+ return is_truthy
68
+ end
69
+
70
+ def handle_option_any(values)
71
+ values.each do |value|
72
+ if value.is_a? Proc
73
+ is_truthy = handle_proc(value, context)
74
+ else
75
+ is_truthy = handle_default(value)
76
+ end
77
+ return true if is_truthy
78
+ end
79
+
80
+ return false
73
81
  end
74
82
  end
75
83
  end
@@ -1,3 +1,3 @@
1
1
  module VarBlock
2
- VERSION = '1.0.0'.freeze
2
+ VERSION = '1.0.1'.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.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jules Roman B. Polidario