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 CHANGED
@@ -1,3 +1,7 @@
1
+ ## v0.1.6
2
+ * Add helpers for walking up the tree
3
+ * Update hashie dependency restriction
4
+
1
5
  ## v0.1.4
2
6
  * Add `_array` helper
3
7
  * Ensure all helpers are using underscore prefix
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- attribute_struct (0.1.3)
5
- hashie (~> 2.0.5)
4
+ attribute_struct (0.1.6)
5
+ hashie (>= 2.0.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
Binary file
@@ -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', '~> 2.0.5'
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
@@ -4,5 +4,5 @@ class AttributeStruct
4
4
  class Version < ::Gem::Version
5
5
  end
6
6
 
7
- VERSION = Version.new('0.1.4')
7
+ VERSION = Version.new('0.1.6')
8
8
  end
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
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-07-13 00:00:00.000000000 Z
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.5
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.5
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