attribute_struct 0.2.26 → 0.2.28

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: ffc1b51f9ac3efde6741c990da79571eb312b3a1
4
- data.tar.gz: 94ce77d6090d14cbd7ed7d6a214fb0cc6629c22a
3
+ metadata.gz: 41547b7309813fb1da48c6e17e0d063215d08963
4
+ data.tar.gz: 9ebfd315aab3eecc4a92d6a08c3276bddd9538ba
5
5
  SHA512:
6
- metadata.gz: da6542c56f2cafbe72464d14928e77b7cc1833c1b112a31914605f9d5a6af51c464886e8a3cbe5e702cf57e6d5b50d2bee41d8a1e27de23dd8490abe8fff32a0
7
- data.tar.gz: e3830ada5e826def4c2663264f2a2e578f88f2b72f4ae9b41247320f4bb88d3d2b2264280c267ecbcd96eb0202f8aff0cef3d8d7e006935a1cd1b830fd3cd895
6
+ metadata.gz: bb2c29323b1d75a607f097d49e79e5f91649810ae7c066651c09cd890fbe6c0c0266df29930d16c8f8cd5887345dcb9169064cbeb3145d129ca6742590c7194f
7
+ data.tar.gz: bfd1e337210551aea3a1c090ba09b84431b44a1f90d0eaa88d6e25fbfa4412289b6af1400dfb95cb255661d5e17ab3154c0c0f06bc584086bd127da4444e30ab
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## v0.2.28
2
+ * Set internal data at creation time, not after evaluation
3
+
1
4
  ## v0.2.26
2
5
  * Add support for lowercase leading camel casing
3
6
 
@@ -207,6 +207,7 @@ class AttributeStruct < BasicObject
207
207
  base = _klass_new
208
208
  end
209
209
  end
210
+ @table[sym] = base
210
211
  if(block.arity == 0)
211
212
  base.instance_exec(&block)
212
213
  else
@@ -227,6 +228,8 @@ class AttributeStruct < BasicObject
227
228
  end
228
229
  elsif(!args.empty? && block)
229
230
  result = leaf = base = @table.fetch(sym, _klass_new)
231
+ @table[sym] = result
232
+
230
233
  args.flatten.each do |arg|
231
234
  leaf = base[arg]
232
235
  unless(leaf.is_a?(_klass))
@@ -248,7 +251,6 @@ class AttributeStruct < BasicObject
248
251
  else
249
252
  orig = leaf
250
253
  end
251
- @table[sym] = result
252
254
  else
253
255
  if(args.size > 1 && args.all?{|i| i.is_a?(::String) || i.is_a?(::Symbol)} && !_state(:value_collapse))
254
256
  @table[sym] = _klass_new unless @table[sym].is_a?(_klass)
@@ -1,4 +1,4 @@
1
1
  class AttributeStruct < BasicObject
2
2
  # Current library version
3
- VERSION = ::Gem::Version.new('0.2.26')
3
+ VERSION = ::Gem::Version.new('0.2.28')
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: attribute_struct
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.26
4
+ version: 0.2.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Roberts
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-15 00:00:00.000000000 Z
11
+ date: 2015-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bogo