bogo 0.2.8 → 0.2.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/bogo/lazy.rb +17 -3
- data/lib/bogo/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: 4147a55ee937c7f32176f7401c9450fae36c3a34
|
4
|
+
data.tar.gz: fb706011f35266dfd5ad9c84d55d046a0a655db2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31a9b4dad739a3bb2650e9bec4b66c3e064ae09b13ad5b5ee9c3cf147da04acdc7a7c17a327e0b014ea148e4a5ca1b863b9e6bc3f0b00607abd6e697a28fcab0
|
7
|
+
data.tar.gz: 6a90ab84ac9a68e8f0c78d23d0951564a0277ddd69282ae32604c5299cdb2f0bc2d67bbb6f51242f7ba8ffc67cb936ee400a3d5b5979196371bd88cb21a2304e
|
data/CHANGELOG.md
CHANGED
data/lib/bogo/lazy.rb
CHANGED
@@ -136,10 +136,24 @@ module Bogo
|
|
136
136
|
self.class.on_missing(self) unless data.has_key?(name) || dirty.has_key?(name)
|
137
137
|
if(dirty.has_key?(name))
|
138
138
|
dirty[name]
|
139
|
-
elsif(data.has_key?(name))
|
140
|
-
data[name]
|
141
139
|
else
|
142
|
-
|
140
|
+
if(data.has_key?(name))
|
141
|
+
val = data[name]
|
142
|
+
else
|
143
|
+
val = self.class.attributes[name][:default]
|
144
|
+
end
|
145
|
+
if(val.respond_to?(:dup))
|
146
|
+
begin
|
147
|
+
val = val.dup
|
148
|
+
rescue
|
149
|
+
val
|
150
|
+
end
|
151
|
+
end
|
152
|
+
if(val.respond_to?(:freeze))
|
153
|
+
val.freeze
|
154
|
+
else
|
155
|
+
val
|
156
|
+
end
|
143
157
|
end
|
144
158
|
end
|
145
159
|
define_method("#{name}=") do |val|
|
data/lib/bogo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bogo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Roberts
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hashie
|