Added default values.
This commit is contained in:
parent
13d590631b
commit
960796d23d
|
@ -59,7 +59,7 @@ module Google
|
||||||
case v['type']
|
case v['type']
|
||||||
when 'string'
|
when 'string'
|
||||||
define_method(property_name) do
|
define_method(property_name) do
|
||||||
self[k]
|
self[k] || v['default']
|
||||||
end
|
end
|
||||||
define_method(property_name + '=') do |value|
|
define_method(property_name + '=') do |value|
|
||||||
if value.respond_to?(:to_str)
|
if value.respond_to?(:to_str)
|
||||||
|
@ -77,7 +77,7 @@ module Google
|
||||||
|
|
||||||
# Don't know what this is, default to anything goes.
|
# Don't know what this is, default to anything goes.
|
||||||
define_method(property_name) do
|
define_method(property_name) do
|
||||||
self[k]
|
self[k] || v['default']
|
||||||
end
|
end
|
||||||
define_method(property_name + '=') do |value|
|
define_method(property_name + '=') do |value|
|
||||||
self[k] = value
|
self[k] = value
|
||||||
|
|
Loading…
Reference in New Issue