Project

General

Profile

Actions

Feature #2084

closed

Method#source_location and Methods Created with `attr`

Added by runpaint (Run Paint Run Run) over 15 years ago. Updated over 13 years ago.

Status:
Closed
Target version:
[ruby-core:25532]

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

save_attr_loc.patch (5.1 KB) save_attr_loc.patch wanabe (_ wanabe), 01/25/2010 09:56 AM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0