structure.rb in structure-0.28.2 vs structure.rb in structure-0.28.3
- old
+ new
@@ -72,13 +72,15 @@
private
def attribute(name, &blk)
name = name.to_s
module_eval "def #{name}?; #{name}; end" if name.chomp!('?')
- module_eval "def #{name}; @#{name} ||= _#{name}.freeze; end"
+ module_eval "def #{name}; return @#{name} if defined?(@#{name}); @#{name} = _#{name}.freeze; end"
define_method("_#{name}", blk)
private "_#{name}"
@attribute_names << name
+
+ name.to_sym
end
end
end