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



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

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



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

def name
  @name
end

#ownerObject

Returns the value of attribute owner



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

def owner
  @owner
end

#tag_nameObject

Returns the value of attribute tag_name



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

def tag_name
  @tag_name
end

Instance Method Details

#tagsObject



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

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