Included Modules

RDoc::Attr

An attribute created by #attr, #attr_reader, #attr_writer or #attr_accessor

Attributes

name[RW]

Name of the attribute

rw[RW]

Is the attribute readable, writable or both?

text[RW]

Source file token stream

visibility[RW]

public, protected, private

Public Class Methods

new(text, name, rw, comment) click to toggle source
    # File lib/rdoc/attr.rb, line 31
31:   def initialize(text, name, rw, comment)
32:     super()
33:     @text = text
34:     @name = name
35:     @rw = rw
36:     @visibility = :public
37:     self.comment = comment
38:   end

Public Instance Methods

<=>(other) click to toggle source

Attributes are ordered by name

    # File lib/rdoc/attr.rb, line 43
43:   def <=>(other)
44:     self.name <=> other.name
45:   end
==(other) click to toggle source

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
aref() click to toggle source

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
arglists() click to toggle source

Returns nil, for duck typing with RDoc::AnyMethod

    # File lib/rdoc/attr.rb, line 68
68:   def arglists
69:   end
block_params() click to toggle source

Returns nil, for duck typing with RDoc::AnyMethod

    # File lib/rdoc/attr.rb, line 74
74:   def block_params
75:   end
call_seq() click to toggle source

Returns nil, for duck typing with RDoc::AnyMethod

    # File lib/rdoc/attr.rb, line 80
80:   def call_seq
81:   end
full_name() click to toggle source

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
html_name() click to toggle source

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
marshal_dump() click to toggle source

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
marshal_load(array) click to toggle source

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
params() click to toggle source

For duck typing with RDoc::AnyMethod, returns nil

     # File lib/rdoc/attr.rb, line 153
153:   def params
154:     nil
155:   end
parent_name() click to toggle source

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
path() click to toggle source

URL path for this attribute

     # File lib/rdoc/attr.rb, line 160
160:   def path
161:     "#{@parent.path}##{@name}"
162:   end
singleton() click to toggle source

For duck typing with RDoc::AnyMethod

     # File lib/rdoc/attr.rb, line 167
167:   def singleton
168:     false
169:   end
type() click to toggle source

Returns attr_reader, attr_writer or attr_accessor as appropriate

     # File lib/rdoc/attr.rb, line 178
178:   def type
179:     case @rw
180:     when 'RW' then 'attr_accessor'
181:     when 'R'  then 'attr_reader'
182:     when 'W'  then 'attr_writer'
183:     end
184:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.