Skip to content

Commit

Permalink
don't override existing getters and setters
Browse files Browse the repository at this point in the history
  • Loading branch information
stevegraham committed Aug 6, 2010
1 parent 887030b commit 9d38c64
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/glamazon/attributes.rb
Expand Up @@ -33,8 +33,8 @@ def write_attribute(attribute, value)
def add_attribute(attribute)
metaclass.class_eval do
attribute = attribute.to_s.gsub /\=$/, ''
define_method(attribute) { attributes[attribute] }
define_method("#{attribute}=") { |value| attributes[attribute] = value }
define_method(attribute) { attributes[attribute] } unless respond_to? attribute
define_method("#{attribute}=") { |value| attributes[attribute] = value } unless respond_to? "#{attribute}="
end
end

Expand Down

0 comments on commit 9d38c64

Please sign in to comment.