Class: Module
- Inherits:
-
Object
- Object
- Module
- Defined in:
- lib/anise/module.rb
Instance Method Summary collapse
-
#attribute_methods ⇒ Object
Module extension to return attribute methods.
Instance Method Details
#attribute_methods ⇒ Object
Module extension to return attribute methods. These are all methods that start with ‘attr_`. This method can be overriden in special cases to work with attribute annotations.
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/anise/module.rb', line 5 def attribute_methods list = [] public_methods(true).each do |m| list << m if m.to_s =~ /^attr_/ end protected_methods(true).each do |m| list << m if m.to_s =~ /^attr_/ end private_methods(true).each do |m| list << m if m.to_s =~ /^attr_/ end return list end |