invariable 0.1.6 → 0.1.7

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: 7383243bf91697ac7bf303aacee00e9d05e67ce84f44552c71ec6c1cb5f3f7cd
4
- data.tar.gz: c76a032018adade6412f3bef21903bbed7ad9c55b1f7d4584ce01621ee31c2d7
3
+ metadata.gz: 99bb0d3d7fca01b1a3d5bdbe965a43f4dd5bbc95f90e9278a81eeb7b00448c86
4
+ data.tar.gz: 90adb109963224f9e4b5638e6065ab8366d78e4be3f63f7aa99c7f321feeaeaa
5
5
  SHA512:
6
- metadata.gz: f46f26ae8e84432bff462a31b686feb84a1d6eeeeb2d47251a6269d6a86bb9189ab766377e0976f80ac1390c898b1a6d68d2daf8d58c32bd7ccca28194f280d0
7
- data.tar.gz: fa0fecd3fd9add3ea732ac6655c20be6e20acda2232c84d0d959397bddc89e050852a34f8d56822c34a5511712a0e2c14484006b321701947438f73bae15e7ae
6
+ metadata.gz: 65052fcc48d1ef7259424c0e7abb63d6f47cbf813de785ce39df80aaa0d566175021d0070ffccde09a36c92107acdd93260385f643cc6e07e803c0cee3612a76
7
+ data.tar.gz: 692ba41bae06488d1ada5be7f02aa4a3045538999f38340b1fea583113061363193553885cceddb80813d37543901af59afd093ef849ee7c0f12d1183c56078a
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Invariable
4
4
  # current version number
5
- VERSION = '0.1.6'
5
+ VERSION = '0.1.7'
6
6
  end
data/lib/invariable.rb CHANGED
@@ -237,14 +237,14 @@ module Invariable
237
237
  @__hash__ ||= (@__attr__.values << self.class).hash
238
238
  end
239
239
 
240
- #
241
- # @return [String] description of itself as a string
242
- #
240
+ alias __to_s to_s
241
+ private :__to_s
242
+
243
+ # @!visibility private
243
244
  def inspect
244
245
  attributes = @__attr__.map { |k, v| "#{k}: #{v.inspect}" }
245
- "<#{self.class}::#{__id__} #{attributes.join(', ')}>"
246
+ "#{__to_s[..-2]} #{attributes.join(', ')}>"
246
247
  end
247
- alias to_s inspect
248
248
 
249
249
  #
250
250
  # @return [Boolean] whether the given name is a valid attribute name
@@ -372,10 +372,9 @@ module Invariable
372
372
 
373
373
  def __attr__init
374
374
  if superclass.instance_variable_defined?(:@__attr__)
375
- Hash[superclass.instance_variable_get(:@__attr__)]
376
- else
377
- {}.compare_by_identity
375
+ return Hash[superclass.instance_variable_get(:@__attr__)]
378
376
  end
377
+ {}.compare_by_identity
379
378
  end
380
379
  end
381
380
  private_constant(:InvariableClassMethods)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: invariable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Blumtritt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-15 00:00:00.000000000 Z
11
+ date: 2022-12-27 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |
14
14
  An Invariable bundles a number of read-only attributes.
@@ -41,14 +41,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
41
41
  requirements:
42
42
  - - ">="
43
43
  - !ruby/object:Gem::Version
44
- version: 2.7.0
44
+ version: 3.0.0
45
45
  required_rubygems_version: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - ">="
48
48
  - !ruby/object:Gem::Version
49
49
  version: '0'
50
50
  requirements: []
51
- rubygems_version: 3.3.7
51
+ rubygems_version: 3.4.1
52
52
  signing_key:
53
53
  specification_version: 4
54
54
  summary: The Invariable data class for Ruby.