var_block 1.0.8 → 1.1.0

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: ac9d2bc0f98ab4a3626258dba97e546479508d9d
4
- data.tar.gz: 114fed4042a44afc92fa28f2f83dbea9b70e5b08
3
+ metadata.gz: 52500dddb01957bd7bb27a4bd350eae5561f5d95
4
+ data.tar.gz: 49ced4748df76620efe0c004d5a64ac860393265
5
5
  SHA512:
6
- metadata.gz: c4ee7e0360307762d52c9af171f2dc66212a77962689e3b33f286f825c19ef65ebfa0eddda303ce0590077e85c94281a2ac3b1c47d03cd01dd22b0828e943959
7
- data.tar.gz: 67587e73f748dd52500512beed3fe590c2bed9d3f639bbfff46496bfd69eba5979591dc5d3b8098e24710513f5d9b4a23821246026bb2ed5d6b1432efd1416ee
6
+ metadata.gz: 8ef3e539293ec016b650cf31241f5963c071b5b4e132cfefe81a5fcac0681fa54a17127536ed700ea12b898619c4aec7384eb26a9222c3f04dee6b98243e3bf9
7
+ data.tar.gz: 6db49ae3b929ddebf69da7744188b0c73f71f73cce814cb2200119f4a757b36c4065dab73da7eace2c3a954cf8f0a1ca4eb6693e0af3d1bf2b902710d0c49af2
@@ -11,7 +11,7 @@ module VarBlock
11
11
  base.extend self
12
12
  end
13
13
 
14
- def getvar(var_hash, index, *options)
14
+ def varblock_get(var_hash, index, *options)
15
15
  unsupported_options = (options - VarBlock::GetvarHandlers::OPTIONS)
16
16
  raise ArgumentError, "3rd argument options Array only supports #{VarBlock::GetvarHandlers::OPTIONS}. Does not support #{unsupported_options.map(&:inspect).join(', ')}" if unsupported_options.any?
17
17
  raise ArgumentError, "1st argument should be a VarHash object, but is found to be a #{var_hash.class}" unless var_hash.is_a? VarHash
@@ -31,7 +31,7 @@ module VarBlock
31
31
  return_value
32
32
  end
33
33
 
34
- def with(var_hash_parent = nil, **variables)
34
+ def varblock_with(var_hash_parent = nil, **variables)
35
35
  var_hash = VarHash.new_from_var_hash(var_hash: var_hash_parent)
36
36
 
37
37
  variables.each do |key, value|
@@ -15,13 +15,12 @@ module VarBlock
15
15
  new_var_hash
16
16
  end
17
17
 
18
- def with(variables = {})
18
+ def varblock_with(variables = {})
19
19
  super(self, variables)
20
20
  end
21
21
 
22
- # OVERRIDES Hash `merge`
23
- def merge(variables)
24
- raise ArgumentError, '`merge` does not accept a block. Are you looking for `merged_with` instead?' if block_given?
22
+ def varblock_merge(variables)
23
+ raise ArgumentError, '`varblock_merge` does not accept a block. Are you looking for `varblock_merged_with` instead?' if block_given?
25
24
 
26
25
  variables.each do |key, value|
27
26
  current_value = self[key]
@@ -41,10 +40,10 @@ module VarBlock
41
40
  end
42
41
  end
43
42
 
44
- def merged_with(variables = {})
43
+ def varblock_merged_with(variables = {})
45
44
  cloned_self = self.clone
46
- cloned_self.merge(variables)
47
- cloned_self.with() { yield(cloned_self) }
45
+ cloned_self.varblock_merge(variables)
46
+ cloned_self.varblock_with() { yield(cloned_self) }
48
47
  end
49
48
  end
50
49
  end
@@ -1,3 +1,3 @@
1
1
  module VarBlock
2
- VERSION = '1.0.8'.freeze
2
+ VERSION = '1.1.0'.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.8
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jules Roman B. Polidario
@@ -94,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
94
  version: '0'
95
95
  requirements: []
96
96
  rubyforge_project:
97
- rubygems_version: 2.4.5.1
97
+ rubygems_version: 2.6.11
98
98
  signing_key:
99
99
  specification_version: 4
100
100
  summary: DSL for variable scoping / encapsulation for readability and organisation,