gobl 0.4.0 → 0.4.1
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 +4 -4
- data/lib/gobl/map.rb +5 -1
- data/lib/gobl/value.rb +19 -0
- data/lib/gobl/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 594b838941c29e9ce2bfe2747abbb937e2c767fe214b77d76ad3ffb2020f8d63
|
4
|
+
data.tar.gz: aeb80a2111b5f5461ab8400cd6e5750f14c2844ddf573f6e5c5eff2a692126c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33a72c1f33a5105707b03f5fecaa43dd12b2d98992326c7c439e99caf25a482506843f93fe651df63a075f8e14bb57d5c8cb5b4c0476836bb3c58cd7a5282031
|
7
|
+
data.tar.gz: 9364242fea9d335b1a82f5c056215aaf25008b2ee9b5c39c1d16d127eab52d71655d0ed4d6b71a28dcb376e684c46c67dc411cc6647382354cfa8a0976eea322
|
data/lib/gobl/map.rb
CHANGED
@@ -48,6 +48,10 @@ module GOBL
|
|
48
48
|
# Returns the number of entries in the map
|
49
49
|
# @return [Integer] the number of entries in the map
|
50
50
|
#
|
51
|
+
# @!method values
|
52
|
+
# Returns an array with the values in the map
|
53
|
+
# @return [Array] the values in the map
|
54
|
+
#
|
51
55
|
# @!method each_key
|
52
56
|
# Iterates over each key in the map
|
53
57
|
# @overload each(&block)
|
@@ -57,6 +61,6 @@ module GOBL
|
|
57
61
|
# @overload each
|
58
62
|
# Returns an Enumerator that iterates over the keys in the map
|
59
63
|
# @return [Enumerator] the enumerator of the keys
|
60
|
-
def_delegators :_map, :[], :each, :empty?, :length, :each_key
|
64
|
+
def_delegators :_map, :[], :each, :empty?, :length, :each_key, :values
|
61
65
|
end
|
62
66
|
end
|
data/lib/gobl/value.rb
CHANGED
@@ -46,6 +46,25 @@ module GOBL
|
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
49
|
+
# Returns whether the current value is equal to a given one, unlike `#==`, without
|
50
|
+
# doing any coercion. That is, the other object must be of the same class to return
|
51
|
+
# true.
|
52
|
+
#
|
53
|
+
# @param other [Object] the other value to compare with
|
54
|
+
#
|
55
|
+
# @return [Boolean] `true` if the values are equal, `false` otherwise
|
56
|
+
def eql?(other)
|
57
|
+
self.class == other.class && _value.eql?(other._value)
|
58
|
+
end
|
59
|
+
|
60
|
+
# Returns a integer hash code of the current value that respects the following
|
61
|
+
# property: Given objects `a` and `b`. If `a.eql?(b)`, then `a.hash == b.hash`.
|
62
|
+
#
|
63
|
+
# @return [Integer] hash code of the current value
|
64
|
+
def hash
|
65
|
+
[self.class.name, _value].hash
|
66
|
+
end
|
67
|
+
|
49
68
|
# @api private
|
50
69
|
def as_json(...)
|
51
70
|
_value.as_json(...)
|
data/lib/gobl/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gobl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Lilue
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2022-
|
13
|
+
date: 2022-12-13 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -194,7 +194,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
194
194
|
- !ruby/object:Gem::Version
|
195
195
|
version: 3.1.4
|
196
196
|
requirements: []
|
197
|
-
rubygems_version: 3.3.
|
197
|
+
rubygems_version: 3.3.26
|
198
198
|
signing_key:
|
199
199
|
specification_version: 4
|
200
200
|
summary: Minimalist ruby version of the GOBL library
|