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:
parent
7963099b90
commit
9eb3e637fb
1 changed files with 12 additions and 1 deletions
|
@ -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
|
Loading…
Reference in a new issue