Class: YARD::Tags::RefTagList

Inherits:
Object
  • Object
show all
Defined in:
lib/yard/tags/ref_tag_list.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tag_name, owner, name = nil) ⇒ RefTagList

Returns a new instance of RefTagList.



7
8
9
10
11
# File 'lib/yard/tags/ref_tag_list.rb', line 7

def initialize(tag_name, owner, name = nil)
  @owner = CodeObjects::Proxy === owner ? owner : P(owner)
  @tag_name = tag_name.to_s
  @name = name
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/yard/tags/ref_tag_list.rb', line 5

def name
  @name
end

#ownerObject

Returns the value of attribute owner.



5
6
7
# File 'lib/yard/tags/ref_tag_list.rb', line 5

def owner
  @owner
end

#tag_nameObject

Returns the value of attribute tag_name.



5
6
7
# File 'lib/yard/tags/ref_tag_list.rb', line 5

def tag_name
  @tag_name
end

Instance Method Details

#tagsObject



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/yard/tags/ref_tag_list.rb', line 13

def tags
  if owner.is_a?(CodeObjects::Base)
    o = owner.tags(tag_name)
    o = o.select {|t| t.name.to_s == name.to_s } if name
    o.each do |t|
      t.extend(RefTag)
      t.owner = owner
    end
    o
  else
    []
  end
end