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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b66cd52e71bcf9cf6aa84d4e65a3b46281840d413297c31879eaf7f01aeffba9
4
- data.tar.gz: f3bc7db46a2af0206e3eedaff0e181b2d3b5ce39ebd9b013ab55f90f47e81600
3
+ metadata.gz: 594b838941c29e9ce2bfe2747abbb937e2c767fe214b77d76ad3ffb2020f8d63
4
+ data.tar.gz: aeb80a2111b5f5461ab8400cd6e5750f14c2844ddf573f6e5c5eff2a692126c5
5
5
  SHA512:
6
- metadata.gz: ea33a787604ca58d7c0eb1ce24818c681c0c8379186b5705c3677377d84a11c1447329e0acb6682f0badf8b4cb5a65a1f7327f6d05812e0cab2f81d6a530ddb3
7
- data.tar.gz: 3d14b5a8257fd4fef38467eb5f8fe236aca6bd8d9ba11359d745831368d3f53f5883c4ac7cb87ebb91b1489ae2b48774ae64ff373640c2fe5fc4071bc87dd8d1
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GOBL
4
- VERSION = '0.4.0'
4
+ VERSION = '0.4.1'
5
5
  end
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.0
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-11-30 00:00:00.000000000 Z
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.7
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