mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
AttributeMethods refector suffix method added some usages
This commit is contained in:
committed by
Xavier Noria
parent
7963099b90
commit
9eb3e637fb
@@ -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
|
||||
Reference in New Issue
Block a user