An attribute created by #attr, #attr_reader, #attr_writer or #attr_accessor
Attributes are ordered by name
# File lib/rdoc/attr.rb, line 43
43: def <=>(other)
44: self.name <=> other.name
45: end
Attributes are equal when their names and rw is identical
# File lib/rdoc/attr.rb, line 50
50: def == other
51: self.class == other.class and
52: self.name == other.name and
53: self.rw == other.rw
54: end
HTML fragment reference for this attr
# File lib/rdoc/attr.rb, line 59
59: def aref
60: type = singleton ? 'c' : 'i'
61:
62: "attribute-#{type}-#{CGI.escape name}"
63: end
Returns nil, for duck typing with RDoc::AnyMethod
# File lib/rdoc/attr.rb, line 68
68: def arglists
69: end
Returns nil, for duck typing with RDoc::AnyMethod
# File lib/rdoc/attr.rb, line 74
74: def block_params
75: end
Returns nil, for duck typing with RDoc::AnyMethod
# File lib/rdoc/attr.rb, line 80
80: def call_seq
81: end
Partially bogus as Attr has no parent. For duck typing with RDoc::AnyMethod.
# File lib/rdoc/attr.rb, line 87
87: def full_name
88: @full_name ||= "#{@parent ? @parent.full_name : '(unknown)'}##{name}"
89: end
An HTML id-friendly representation of name
# File lib/rdoc/attr.rb, line 94
94: def html_name
95: @name.gsub(/[^a-z]+/, '-')
96: end
Dumps this Attr for use by ri. See also marshal_load
# File lib/rdoc/attr.rb, line 116
116: def marshal_dump
117: [ MARSHAL_VERSION,
118: @name,
119: full_name,
120: @rw,
121: @visibility,
122: parse(@comment),
123: ]
124: end
Loads this AnyMethod from array. For a loaded AnyMethod the following methods will return cached values:
# File lib/rdoc/attr.rb, line 133
133: def marshal_load array
134: @name = array[1]
135: @full_name = array[2]
136: @rw = array[3]
137: @visibility = array[4]
138: @comment = array[5]
139:
140: @parent_name = @full_name
141: end
For duck typing with RDoc::AnyMethod, returns nil
# File lib/rdoc/attr.rb, line 153
153: def params
154: nil
155: end
Name of our parent with special handling for un-marshaled methods
# File lib/rdoc/attr.rb, line 146
146: def parent_name
147: @parent_name || super
148: end
URL path for this attribute
# File lib/rdoc/attr.rb, line 160
160: def path
161: "#{@parent.path}##{@name}"
162: end
For duck typing with RDoc::AnyMethod
# File lib/rdoc/attr.rb, line 167
167: def singleton
168: false
169: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.