structure 0.12.0 → 0.12.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.
- data/lib/structure/json.rb +0 -2
- data/lib/structure/static.rb +1 -1
- data/lib/structure/version.rb +1 -1
- data/lib/structure.rb +5 -6
- metadata +2 -2
data/lib/structure/json.rb
CHANGED
data/lib/structure/static.rb
CHANGED
data/lib/structure/version.rb
CHANGED
data/lib/structure.rb
CHANGED
@@ -12,7 +12,6 @@ class Structure
|
|
12
12
|
TYPES = [Array, Boolean, Float, Hash, Integer, String, Structure]
|
13
13
|
|
14
14
|
class << self
|
15
|
-
|
16
15
|
# A shortcut to define an attribute that represents an array of other
|
17
16
|
# objects, possibly structures.
|
18
17
|
def embeds_many(name)
|
@@ -145,10 +144,10 @@ class Structure
|
|
145
144
|
|
146
145
|
private
|
147
146
|
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
end
|
147
|
+
def initialize_attributes
|
148
|
+
@attributes = {}
|
149
|
+
self.class.default_attributes.each do |key, value|
|
150
|
+
@attributes[key] = value.is_a?(Array) ? value.dup : value
|
153
151
|
end
|
152
|
+
end
|
154
153
|
end
|