dolly 0.5.6 → 0.5.7

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: 37d11cb189ae9798e2f378111955284068d7d040
4
- data.tar.gz: 76051188f1787521bd8bc2c39ba7cee148977561
3
+ metadata.gz: 2a6f4cc93cbfb6e3efc584188c23775282d6bd95
4
+ data.tar.gz: 2bf8db9298eee2e91925d1edc9e1536e1ce435db
5
5
  SHA512:
6
- metadata.gz: a978202c81fb3894a93e1bad90008f68b807bb221303dbbb06448c20fb9fe31ebf1152b443c72624493397043d32485ec6b05038c53bc7ce500b1de880b0af17
7
- data.tar.gz: df4d93f97050fbeecc591ad243fed43ecc7bf2ed13b4aa314c961da6d1587f9c84ff2648bd450c3c7e4a45dec3c5fb002a11b2c1100d04c6237ac91c67fe8d08
6
+ metadata.gz: 90b551dbf530f8e36fa6f35e1ab307478096514db83bd78d603e4bdf62e93aedcb7c5d6b4a0c4822d5ff171f5521c306f60c477620a76b5df72c583d4e447f2b
7
+ data.tar.gz: 2a3e019741cb1e7d6b193537bcce6bb8ade95b9a4231a40b27e094b4254bd47ac054f95fbe6d985d3232843ea75cc771a5bda35fc03755dbc77c7514805cecfa
@@ -86,12 +86,14 @@ module Dolly
86
86
  options ||= {}
87
87
  self.properties ||= []
88
88
 
89
+ default_value = options[:default]
90
+
89
91
  self.properties += ary.map do |name|
90
92
  options.merge!({name: name})
91
93
  property = Property.new(options)
92
94
 
93
95
  define_method(name) do
94
- property.value = @doc[name.to_s]
96
+ property.value = @doc[name.to_s] || default_value
95
97
  property.value
96
98
  end
97
99
 
data/lib/dolly/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Dolly
2
- VERSION = "0.5.6"
2
+ VERSION = "0.5.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dolly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6
4
+ version: 0.5.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - javierg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-07 00:00:00.000000000 Z
11
+ date: 2014-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails