Actions
Feature #2084
closedMethod#source_location and Methods Created with `attr`
Feature #2084:
Method#source_location and Methods Created with `attr`
Description
=begin
$ cat /tmp/attr.rb
class C
attr :a
end
p C.instance_methods(false)
p C.instance_method(:a).source_location
$ ruby -v /tmp/attr.rb
ruby 1.9.2dev (2009-09-11) [i686-linux]
[:a]
nil
Is it feasible to have Method#source_location work with methods created with attr(and friends)? Given that a common use for this feature is to extract documentation, it would be helpful if such methods could be located by introspection.
=end
Files
Actions