mimi-struct 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a37be40de19ddfe65927cd3bef957db71979360d
4
- data.tar.gz: 1e724f9d02e10c4fc59353af4f5e6e9121d79e7f
3
+ metadata.gz: 97dd772b1e54d4b038de28dc8c6a8027089e5191
4
+ data.tar.gz: 9589fadd70dd789bee5c8ba22944b3de6d3e0370
5
5
  SHA512:
6
- metadata.gz: 0302621a9b95b236a61c578533de6db60386a3d4e96445b1a6af8291fe0aa2658cf37895acf9429f2b50221922c5c4e32ed3f8c2f3bf95a9872aa13235d65f0b
7
- data.tar.gz: 8bf489c4861b644fb9b00f0a64ecb797b86967a32a8a6f2121f26bed3a5b39ad588583af41e6ef1faafbfb30c18893caa3ac445ff1e58bd449842d0e3d21868b
6
+ metadata.gz: f12d000c3e5d5f16e4ed879333846925df7a0489d05451cb4b8e45dc675e5cdb500dc56750bcdb1f8e3928847eeb1adab86fbb307f1802d64c277bf28bdcbda1
7
+ data.tar.gz: 4474ea3a62a2fcda7139543b68e63defad3419e0b3308d3b1a1df1df35df7e7f1f5c8dc801d276219ddd87b91e50170e8031280fcd23b3776f48090eb5d3f1a1
@@ -140,14 +140,23 @@ module Mimi
140
140
  end
141
141
  end
142
142
 
143
- # Returns a Hash of attribute definitions
143
+ # Returns a Hash of attribute definitions defined in this class
144
+ # and all its ancestors
144
145
  #
145
146
  # @return [Hash]
146
147
  #
147
- private_class_method def self.attribute_definitions
148
- @attribute_definitions ||= {}
149
- # merge with base class
150
- defined?(super) ? super.merge(@attribute_definitions) : @attribute_definitions
148
+ # NOTE: this is a _protected_ class method
149
+ #
150
+ class << self
151
+ protected
152
+ def attribute_definitions
153
+ @attribute_definitions ||= {}
154
+ # merge with superclass attribute definitions
155
+ superclass_attribute_definitions =
156
+ superclass < Mimi::Struct ? superclass.attribute_definitions : {}
157
+ superclass_attribute_definitions.merge(@attribute_definitions)
158
+ # defined?(super) ? super.merge(@attribute_definitions) : @attribute_definitions
159
+ end
151
160
  end
152
161
 
153
162
  # Adds a new attribute definition
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mimi
4
- Struct_VERSION = "1.1.0"
4
+ Struct_VERSION = "1.1.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mimi-struct
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Kukushkin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-06-30 00:00:00.000000000 Z
11
+ date: 2019-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mimi-core