lib/virtus/support/options.rb in virtus-1.0.2 vs lib/virtus/support/options.rb in virtus-1.0.3
- old
+ new
@@ -59,9 +59,10 @@
#
# @api private
def define_option_method(option)
class_eval <<-RUBY, __FILE__, __LINE__ + 1
def self.#{option}(value = Undefined) # def self.primitive(value = Undefined)
+ @#{option} = nil unless defined?(@#{option}) # @primitive = nil unless defined?(@primitive)
return @#{option} if value.equal?(Undefined) # return @primitive if value.equal?(Undefined)
@#{option} = value # @primitive = value
self # self
end # end
RUBY