deep_class_compare 1.1.0 → 1.2.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
  SHA256:
3
- metadata.gz: 68550ce38b16ba3893f248bdb92b05ea47f954ac0c3eb64310e6df61d7f100de
4
- data.tar.gz: 6cf088ad09a99e5a24be7055e217cf5a857d6bdad9d95319ff96576bbece0325
3
+ metadata.gz: d1314a84c10e3451db03f8f7ae49d30882d3141ca195fdc814d32be8106a7ab7
4
+ data.tar.gz: 3d588cad72468cbc5e4f228883277e9d43151487298985a8e672be3171b0db7a
5
5
  SHA512:
6
- metadata.gz: be85adfd779297454cbfe6eedc2d9f61321fdfc52e0b9fb2a19a07780fa04830d52b2b33b30b7dc8119d164ede0d9896ac999ffca713644ff5b7f72b4b625c74
7
- data.tar.gz: c49a4178b7445a1eb858ddd7701d0b03f4d9fa2d1608f0f43987cc5d4b8c4c8a0b523f3b32354fa092a9e001d3e3725b2a068030a2d5593c2b9d7fc756ab11dd
6
+ metadata.gz: 006b39582ee835dcc33164c4af63518d24082293da5c3545a6e0b65ba9006f0c96760c5b59f05f7a3444e104b0bd4e355f41131231da63d99936cc5e6aeb10bf
7
+ data.tar.gz: 47f013d36af50c17c167f2ddb19821bb19ce131f9929fb046314988fbeb9abbc0a03c2a38d3e1b1de2e1731807b2d4010a3b09a0ba677b42e8322c8491e3f24b
@@ -1,8 +1,8 @@
1
1
  module DeepClassCompare
2
2
  class ArrayMatcher < Matcher
3
3
  include ContainerComparable
4
- def initialize
5
- super(Array)
4
+ def initialize(klass = Array)
5
+ super(klass)
6
6
  end
7
7
 
8
8
  def match?(array)
@@ -1,8 +1,8 @@
1
1
  module DeepClassCompare
2
2
  class HashMatcher < Matcher
3
3
  include ContainerComparable
4
- def initialize
5
- super(Hash)
4
+ def initialize(klass = Hash)
5
+ super(klass)
6
6
  end
7
7
 
8
8
  def match?(hash)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DeepClassCompare
4
- VERSION = "1.1.0"
4
+ VERSION = "1.2.0"
5
5
  end
@@ -12,14 +12,14 @@ end
12
12
 
13
13
  class Array
14
14
  def self.of(value_comparable)
15
- DeepClassCompare::ArrayMatcher.new.of(value_comparable)
15
+ DeepClassCompare::ArrayMatcher.new(self).of(value_comparable)
16
16
  end
17
17
  end
18
18
 
19
19
  class Hash
20
20
  def self.of(key_comparable, value_comparable = nil)
21
21
  key_comparable, value_comparable = Object, key_comparable if value_comparable.nil?
22
- DeepClassCompare::HashMatcher.new.of(key_comparable, value_comparable)
22
+ DeepClassCompare::HashMatcher.new(self).of(key_comparable, value_comparable)
23
23
  end
24
24
  end
25
25
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deep_class_compare
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Koten
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-12-26 00:00:00.000000000 Z
11
+ date: 2021-12-31 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A container class extend gem that could compare the values class in it
14
14
  easily, clearly, and more colloquialism.