Class: Module

Inherits:
Object
  • Object
show all
Includes:
Anise::Annotations
Defined in:
lib/anise/core_ext.rb,
lib/anise/universal.rb

Overview

require ‘facets/inheritor’ # removed dependency

Instance Method Summary collapse

Methods included from Anise::Annotations

#ann, #ann!, #annotation_added, #annotations

Instance Method Details

#attribute_methodsObject

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.



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/anise/core_ext.rb', line 9

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