Class: YARD::Tags::OverloadTag

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

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (OverloadTag) initialize(tag_name, text)

Returns a new instance of OverloadTag



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

def initialize(tag_name, text)
  super(tag_name, nil)
  parse_tag(text)
  parse_signature
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

- (Object) method_missing(*args, &block)



27
28
29
# File 'lib/yard/tags/overload_tag.rb', line 27

def method_missing(*args, &block)
  object.send(*args, &block)
end

Instance Attribute Details

- (Object) docstring (readonly)

Returns the value of attribute docstring



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

def docstring
  @docstring
end

- (String) name Originally defined in class Tag

Returns a name associated with the tag

Returns:

  • (String)

    a name associated with the tag

- (CodeObjects::Base) object Originally defined in class Tag

Returns the associated object

Returns:

- (Object) parameters (readonly)

Returns the value of attribute parameters



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

def parameters
  @parameters
end

- (Object) signature (readonly)

Returns the value of attribute signature



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

def signature
  @signature
end

- (String) tag_name Originally defined in class Tag

Returns the name of the tag

Returns:

  • (String)

    the name of the tag

- (String?) text Originally defined in class Tag

Returns:

  • (String)

    the tag text associated with the tag

  • (nil)

    if no tag text is supplied

- (Array<String>?) types Originally defined in class Tag

Returns:

  • (Array<String>)

    a list of types associated with the tag

  • (nil)

    if no types are associated with the tag

Instance Method Details

- (Boolean) has_tag?(name)

Returns:

  • (Boolean)


14
# File 'lib/yard/tags/overload_tag.rb', line 14

def has_tag?(name) docstring.has_tag?(name) end

- (Boolean) is_a?(other) Also known as: kind_of?

Returns:

  • (Boolean)


35
36
37
# File 'lib/yard/tags/overload_tag.rb', line 35

def is_a?(other)
  object.is_a?(other) || self.class >= other.class || false
end

- (Object) name(prefix = false)



22
23
24
25
# File 'lib/yard/tags/overload_tag.rb', line 22

def name(prefix = false)
  return @name unless prefix
  object.scope == :class ? @name.to_s : "#{object.send(:sep)}#{@name}"
end

- (Object) object=(value)



16
17
18
19
20
# File 'lib/yard/tags/overload_tag.rb', line 16

def object=(value)
  super(value)
  docstring.object = value
  docstring.tags.each {|tag| tag.object = value }
end

- (Object) tag(name)



12
# File 'lib/yard/tags/overload_tag.rb', line 12

def tag(name) docstring.tag(name) end

- (Object) tags(name = nil)



13
# File 'lib/yard/tags/overload_tag.rb', line 13

def tags(name = nil) docstring.tags(name) end

- (Object) type



31
32
33
# File 'lib/yard/tags/overload_tag.rb', line 31

def type
  object.type
end