1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

AttributeMethods refector suffix method added some usages

This commit is contained in:
Vishnu Atrai 2011-08-05 13:34:28 +05:30 committed by Xavier Noria
parent 7963099b90
commit 9eb3e637fb

View file

@ -30,12 +30,23 @@ private
end
def attribute_highest?(attribute)
attribute > 100 ? true : false
send(attribute) > 100 ? true : false
end
end
person = Person.new
person.age = 110
person.age_highest? # true
person.reset_age # 0
person.age_highest? # false
</ruby>
h4. Callbacks
h3. Changelog
* August 5, 2011: Initial version by "Arun Agrawal":http://github.com/arunagw