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 +4 -4
- data/lib/mimi/struct.rb +14 -5
- data/lib/mimi/struct/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97dd772b1e54d4b038de28dc8c6a8027089e5191
|
4
|
+
data.tar.gz: 9589fadd70dd789bee5c8ba22944b3de6d3e0370
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f12d000c3e5d5f16e4ed879333846925df7a0489d05451cb4b8e45dc675e5cdb500dc56750bcdb1f8e3928847eeb1adab86fbb307f1802d64c277bf28bdcbda1
|
7
|
+
data.tar.gz: 4474ea3a62a2fcda7139543b68e63defad3419e0b3308d3b1a1df1df35df7e7f1f5c8dc801d276219ddd87b91e50170e8031280fcd23b3776f48090eb5d3f1a1
|
data/lib/mimi/struct.rb
CHANGED
@@ -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
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
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
|
data/lib/mimi/struct/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2019-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mimi-core
|