mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Support visibility modifiers for attributes
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@5786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
bab666da0b
commit
81f62f41f1
3 changed files with 37 additions and 7 deletions
|
@ -146,9 +146,22 @@ module RDoc
|
|||
# visibility of the corresponding AnyMethod object
|
||||
|
||||
def set_visibility_for(methods, vis, singleton=false)
|
||||
@method_list.each_with_index do |m,i|
|
||||
count = 0
|
||||
@method_list.each do |m|
|
||||
if methods.include?(m.name) && m.singleton == singleton
|
||||
m.visibility = vis
|
||||
count += 1
|
||||
end
|
||||
end
|
||||
|
||||
return if count == methods.size || singleton
|
||||
|
||||
# perhaps we need to look at attributes
|
||||
|
||||
@attributes.each do |a|
|
||||
if methods.include?(a.name)
|
||||
a.visibility = vis
|
||||
count += 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -627,13 +640,14 @@ module RDoc
|
|||
|
||||
# Represent attributes
|
||||
class Attr < CodeObject
|
||||
attr_accessor :text, :name, :rw
|
||||
attr_accessor :text, :name, :rw, :visibility
|
||||
|
||||
def initialize(text, name, rw, comment)
|
||||
super()
|
||||
@text = text
|
||||
@name = name
|
||||
@rw = rw
|
||||
@visibility = :public
|
||||
self.comment = comment
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue