attribute_struct 0.1.4 → 0.1.6
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/CHANGELOG.md +4 -0
- data/Gemfile.lock +2 -2
- data/attribute_struct-0.1.4.gem +0 -0
- data/attribute_struct.gemspec +1 -1
- data/lib/attribute_struct/attribute_struct.rb +14 -0
- data/lib/attribute_struct/version.rb +1 -1
- metadata +7 -6
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
Binary file
|
data/attribute_struct.gemspec
CHANGED
@@ -9,6 +9,6 @@ Gem::Specification.new do |s|
|
|
9
9
|
s.homepage = 'http://github.com/chrisroberts/attribute_struct'
|
10
10
|
s.description = 'Attribute structures'
|
11
11
|
s.require_path = 'lib'
|
12
|
-
s.add_dependency 'hashie', '
|
12
|
+
s.add_dependency 'hashie', '>= 2.0.0'
|
13
13
|
s.files = Dir['**/*']
|
14
14
|
end
|
@@ -284,6 +284,7 @@ class AttributeStruct < BasicObject
|
|
284
284
|
def _klass_new
|
285
285
|
n = _klass.new
|
286
286
|
n._camel_keys_set(_camel_keys_action)
|
287
|
+
n._parent(self)
|
287
288
|
n
|
288
289
|
end
|
289
290
|
|
@@ -298,6 +299,19 @@ class AttributeStruct < BasicObject
|
|
298
299
|
@_camel_keys_set
|
299
300
|
end
|
300
301
|
|
302
|
+
def _parent(obj=nil)
|
303
|
+
@_parent = obj if obj
|
304
|
+
@_parent
|
305
|
+
end
|
306
|
+
|
307
|
+
def _root
|
308
|
+
r = self
|
309
|
+
until(r._parent.nil?)
|
310
|
+
r = r._parent
|
311
|
+
end
|
312
|
+
r
|
313
|
+
end
|
314
|
+
|
301
315
|
# args:: Objects
|
302
316
|
# Helper to create Arrays with nested AttributeStructs. Proc
|
303
317
|
# instances are automatically executed into new AttributeStruct
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: attribute_struct
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,24 +9,24 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-08-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: hashie
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 2.0.
|
21
|
+
version: 2.0.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
none: false
|
26
26
|
requirements:
|
27
|
-
- -
|
27
|
+
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 2.0.
|
29
|
+
version: 2.0.0
|
30
30
|
description: Attribute structures
|
31
31
|
email: chrisroberts.code@gmail.com
|
32
32
|
executables: []
|
@@ -44,6 +44,7 @@ files:
|
|
44
44
|
- test/specs/basic.rb
|
45
45
|
- Gemfile
|
46
46
|
- README.md
|
47
|
+
- attribute_struct-0.1.4.gem
|
47
48
|
- attribute_struct.gemspec
|
48
49
|
- CHANGELOG.md
|
49
50
|
- Gemfile.lock
|