Class: Class

Inherits:
Object show all
Defined in:
lib/mustang/core_ext/class.rb

Instance Method Summary collapse

Instance Method Details

#declared_methodsObject

Returns list of public instance methods of current class excluding methods inherited from the Object.



4
5
6
7
8
9
10
11
12
13
# File 'lib/mustang/core_ext/class.rb', line 4

def declared_methods
  klass, result = self, []

  while not klass == Object
    result += klass.instance_methods(false)
    klass = klass.superclass
  end

  result.map { |m| m.to_sym }
end