lib/rcoli/extensions.rb in rcoli-0.5.3 vs lib/rcoli/extensions.rb in rcoli-0.5.4
- old
+ new
@@ -4,9 +4,13 @@
instance_variable_set(ivar, value)
end
define_method("value_of_#{name}") do
ivar = "@#{name}"
- instance_variable_get(ivar).to_s
+ if (instance_variable_get(ivar))
+ instance_variable_get(ivar).to_s
+ else
+ nil
+ end
end
end